Run Google Drive as a Windows service

July 30, 2014

Run Google Drive as a Windows service

Google Drive was recently released by Google. This “cloud-based file server” is a very attractive off-site backup solution, given its aggressive pricing.The problem with Google Drive and Dropbox is that these programs are meant to run once you logged in your PC: they are not installed as Windows services that can run as background tasks.

Whereas this is a very good solution for PC users, it forces you to log into your server to start their synchronization services after each reboot.

This document is an adaptation of a great Dropbox tutorial found here:

http://blog.dreamfactory.se/2011/01/20/dropbox-as-a-service/, applied to Google Drive.

The following procedure has been successfully tested on a Microsoft Windows Server 2003 Standard Edition with Service Pack 2 installed (32bits), and Google Drive 1.1.3012.0542.

1 – If not already done, download and install the Windows Server 2003 Resource Kit.2 – Install Google Drive. For Google Drive to be able to sign in, you may have to add a few Google servers to the Trusted sites in Internet Explorer. The list of these servers can be found here:

http://support.google.com/drive/bin/answer.py?hl=en&answer=2589954

3 – Right-click on Google Drive tray icon and go to “Preferences…”. Uncheck the “Start Google Drive automatically when you start your computer” option.

4 – Close Google Drive: right-click on Google Drive tray icon and choose “Quit Google Drive”.

5 – We use instsrv and srvany to create a Google Drive service: in a Command Prompt window, move to the Windows Server 2003 Resource Kit folder (default location: C:\Program Files\Windows Resource Kits\Tools) and type the following:
instsrv “Google Drive” “c:\Program Files\Windows Resource Kits\Tools\srvany.exe”
cmd

6 – Click on the Windows “Start” button, go to “Run…” and type services.msc to launch the services management console.
services

7 – Double-click on your newly created Google Drive service, go to the “Log on” tab, click on “This accout”, select Administrator and enter its password.
logon

8 – Click on the Windows “Start” button, go to “Run…” and type regedit to launch the registry editor.

9 – Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Google Drive and create a new key “Parameters”.
regedit

10 – In the “Parameters” key, add a new string value “Application”. Set its value to “C:\Program Files\Google\Drive\googledrivesync.exe”. You can get this information by checking the properties of the Google Drive shortcut in Start -> Programs-> Google Drive, right-click on the Google Drive shortcut and choose “Properties”.

shortcut

11 – Close the registry editor.

12 – Go back to the Services Management Console (Start -> Run… -> services.msc) and start Google Drive service.