Sync Google Drive when not logged in

32,249

Solution 1

Have you tried the Task Scheduler?

http://www.nekocreation.com/sync-google-drive-when-not-logged-in/

From above:

Google Drive will only sync your files automatically when you are logged in to your account on Windows. If you want Google Drive to start even before you are logged in to your account, you can add it to Task Scheduler.

  1. On Windows 7, go to Start > All Programs > Accessories > System Tools > Task Scheduler
  2. Click on Create Task…
  3. Under General Tab
  4. Name: Google Drive Sync
  5. Security options: Run whether user is logged on or not
  6. Under Triggers Tab
  7. Click ‘New…’ button
  8. Begin the task: At startup
  9. Click ‘OK’ button
  10. Under Actions Tab
  11. Click ‘New…’ button
  12. Click ‘Browse…’ button
  13. Locate googledrivesync.exe (By default it is under C:\Program Files (x86)\Google\Drive)
  14. Click ‘OK’ button
  15. Under Settings Tab
  16. Uncheck ‘Stop the task if it runs longer …’
  17. Click ‘OK’ button to save the task

Solution 2

I believe you would have to run the sync client as a service. To do so, you can use Sc.exe.

I can't test this but the syntax should be something like this (from an elevated command prompt):
sc create GoogleDriveService displayName="Google Drive Service Wrapper" start=auto obj=WINDOWS_USERNAME password=PASSWORD binPath=PATH_TO_GOOGLE_DRIVE_EXECUTABLE

Piece by piece:
sc: creates the service
create: command to create service (see also, delete)
GoogleDriveService: a string you make up to give the service a name
displayName="Google Drive Service Wrapper": string shown under Name column of services.msc
start=auto: start on boot
obj=WINDOWS_USERNAME: Windows account that is syncing with Google Drive
password=PASSWORD
binPath=PATH_TO_GOOGLE_DRIVE_EXECUTABLE

Solution 3

@martin There's a bug in Googledrivesync that disables restarts if the "Start on login" switch is enabled in the preferences panel. That's why it's flashing when you restart it. (I would have put this message in the comment thread where it belongs but don't have the points to do so.)

To use Window's task scheduler to control GoogleDriveSync, disable the auto start option in the app's preference panel.

I specifically don't want GoogleDriveSync running most of the time as it interferes with other scripts that create and delete temporary files in the folders GDS backs up. Rather than rewrite the scripts to use a temporary folder outside of GDS's purview, I use the Task Scheduler to control when GDS does and doesn't run.

Share:
32,249

Related videos on Youtube

njr101
Author by

njr101

Updated on September 18, 2022

Comments

  • njr101
    njr101 over 1 year

    I have installed Google Drive on Windows Server 2008 R2. When I login to the server, Google Drive starts automatically and synchrnoizes files, pulling changes down from the cloud. All good so far.

    However, I would like the sync to run even if I am not logged in. Is there any way to start the sync process automatically, maybe as a scheduled task?

    I have other jobs on the server which distribute the files by FTP so I would like the server copies of the files to be up to date.

  • njr101
    njr101 over 11 years
    Which executable needs to be executed and with what switches? What will happen to the service if it is waiting for user input? Will it hang or will it continue to sync? Or is it possible to use the correct switches to prevent the executable from raising any user interaction such as the login dialog?
  • Louis Waweru
    Louis Waweru over 11 years
    @njr101 I would look at the shortcut properties to see if any switches are used. As I don't use it, I can't look into much further.
  • njr101
    njr101 over 11 years
    The shortcut includes a /autostart switch but as I say, this can raise user interaction under some circumstances. I realise that converting an app to a service will allow it to run without a logged-in user, but what I specifically need to know is whether there is a supported model for doing this with Google Drive. Even if not officially supported, at least a method someone has tried and can verify works.
  • Louis Waweru
    Louis Waweru over 11 years
    @njr101 can you give an example of a software that runs while a user is not logged in?
  • njr101
    njr101 over 11 years
    SQL Server, IIS, Oracle, etc. These services all run even if there is no interactive Windows user logged in to the console.
  • Louis Waweru
    Louis Waweru over 11 years
    @njr101 but those are also services.
  • njr101
    njr101 over 11 years
    I realise that they are services. And if I could run Google Drive as a service that would be an ideal solution. But the problem is that the executable can raise interactive dialogs - this obviously cannot work if there is no logged in console user - it would be like trying to run Notepad as a service.
  • Louis Waweru
    Louis Waweru over 11 years
    @njr101 ahh, I didn't understand before.
  • nixda
    nixda over 11 years
    Nice first post. Link seems helpful. what does njr101 say?
  • njr101
    njr101 over 10 years
    Looks like link is broken
  • Ex Umbris
    Ex Umbris over 3 years
    That doesn't seem to work.
  • Ex Umbris
    Ex Umbris over 3 years
    srvany.exe is part of the Microsoft Resource Kit which does not exist for Windows 10.