Standby / Shutdown your computer when DropBox Sync is complete

Leaving computer turned on all night because your friend sent you 600 images on your Dropbox is a bit of pain when you know the download will be over in next two hours. But you cannot help it because by that time you will be in bed.

Get File Or Folder Status In Windows, is a Dropbox add-on which can track the Dropbox sync status and can tell you if the sync is complete or if there is an error. It can check for a specific file and folder. So if you have a big file like a movie or a folder in queue, you can track both of them.

Dropbox Sync Status from Commandline

  • Download this application from here | Official Page.
  • Unzip  and copy the path of that folder.
  • Launch the command prompt and change your directory to that folder.
  • Now type in dbFileStatus “d:\My Dropbox” . Remember if you add a slash at the end it wont work. Hit Enter
  • Now you will get the status update which will be one of these :
    • dropbox not running.
    • not in dropbox
    • up to date
    • syncronising
    • sync problem

Now using this tool alone doesn’t help much.  You can use the below mentioned script which keeps on checking for a DropBox Status which says Sync Complete or UptoDate and then initiates standby or shutdown process of the computer. This script was given by EM T.

@echo off
:START
“C:\The\directory\where\dbFileStatusIsStored\dbFileStatus.exe” “C:\Your\Dropbox\Location\My Dropbox” > dbstatus.txt
findstr /m “up to date” dbstatus.txt
if %errorlevel%==0 (
%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
) else (
SLEEP 30
GOTO START
)

Copy this to a notepad and save it as “.bat” file. Double click to execute and it will keep running.

This script finds the status of the Dropbox using the above application and dumps it into a text file. Then it reads the text file and compares the status with “up to date” status, which indicates that file sync is complete with Dropbox and then sends your computer to stand by. If you want to shutdown, use shutdown -s -t 0.

However make sure you run this file only when you are sure of major download or update has already started else it will standby your system immediately as the status is up to date.

This works on windows only but if you want to use it somewhere else, you can use this Python Script which was the original source of inspiration. You can even see the code which is used and can modify according to your need.


About Ashish Mohta

A Professional Tech blogger, Editor and Writer who talks about solving day to day problems of people who use computer. His expertise are in Windows 7, Microsoft Office, Software, Mobile Apps and Video Posts.

One comment

  1. Hello Ashish, his code doesn’t work (on x64 machines), I know other people are having similar issue, do you know if there is a solution?

Leave a Reply