How to force a Google Drive sync from windows 7 command prompt

google-drive

I am using google drive to sync personal documents when I am at work and need to update a file at home quickly for personal purposes. I have tasks at home running under task manager, which uses these updated files and sometimes they are time sensitive.

So, I need to set up something, which will force a sync on my home computer's google drive folder, before starting the scheduled task and get the latest updates I made on that file, while I am at work.

So far, all my searching points to pausing and restarting the google drive from the tray icon, in order to force a sync, short of shutting it down and restarting it. I tried and found this scheme to be working, but there is no way to replicate the same function from the command line, i.e., there is no such command line switch as:

googledrivesync.exe /pause 

or

googledrivesync.exe /restart

I tried to set up an autohotkey job to do this mouse pointing and clicking job, but due to the inconsistent number of tray icon's it is a hit and miss at best case.

I also tried to kill the googledrivesync.exe using taskkill and restarting it, but, after the run of googledrivesync.exe runs, it leaves a DOS box on the desktop open. And if this is done few more times (and it gets done as my home computer job runs every 15 minutes) the number of these windows, obstruct the running of my scheduled task due to covering the whole screen.

Any other ideas or undocumented google drive features are greatly appreciated.

Best Answer

  1. Kill process GoogleDriveSync
  2. In Command Prompt go to folder, c:\program files\Google\drive\
  3. execute googledrivesync.exe /autostart
Related Question