Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Is there a way to start at program at say 12 am, and stop it at 6 am?


  • Please log in to reply
7 replies to this topic

#1 alpha_3rewqr

alpha_3rewqr

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:07:36 AM

Posted 29 June 2016 - 02:36 PM

Hi
 
I use google drive to backup some of my data onto the google servers. My laptop is a bit slow, so if I keep google drive on all the time, it takes up a lot processor computation, as a result other programs run slow. But I would like to backup the data periodically say at night to the google servers.
 
The google drive unfortunately doesnt have an option to set a time when the upload and sync should happen.
 
So I am wondering if there is a way in windows by which I can start google drive automatically at a certain time and then shut it off automatically at a certain time, regardless of whether the sync has completed or not fully.
 
I am not too worried about the sync not completing fully, because the next time the sync happens, google drive always picks up from where it left off. Also it seems google drive only syncs the files that have changed. On most days, I dont create huge files, so 6 hrs or so with google drive on, should be enough.
 
Thanks
 
Jeff.


BC AdBot (Login to Remove)

 


#2 Aura

Aura

    Bleepin' Special Ops


  • Malware Response Team
  • 19,697 posts
  • ONLINE
  •  
  • Gender:Male
  • Local time:09:36 AM

Posted 29 June 2016 - 02:38 PM

You can easily do that via the Task Scheduler. Add a task at 12AM that starts the Google Drive process, and add a task at 6AM that kills it. I can give you the process name and commands once I get home tonight if needed.

animinionsmalltext.gif
unite_blue.png
Security Administrator | Sysnative Windows Update Senior Analyst | Malware Hunter | @SecurityAura
My timezone UTC-05:00 (East. Coast). If I didn't reply to you within 48 hours, please send me a PM.


#3 alpha_3rewqr

alpha_3rewqr
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:07:36 AM

Posted 30 June 2016 - 01:07 PM

Thanks. I was able to do what you mentioned. However, when the task actually runs through the Task Scheduler, the Google Drive icon that usually appears on the sidebar, never appears. i know the google drive is running, because I can see that the program googledrivesync.exe is taking up 46% of a CPU.

 

Is that what I should expect from running a task using the task scheduler?

 

When I start it manually, or even using the command prompt, the google drive icon does appear on the task bar.



#4 Aura

Aura

    Bleepin' Special Ops


  • Malware Response Team
  • 19,697 posts
  • ONLINE
  •  
  • Gender:Male
  • Local time:09:36 AM

Posted 30 June 2016 - 01:14 PM

When you say that you start it "manually", do you mean by clicking on the Google Drive program icon, or the Google Drive file that launches the process?

animinionsmalltext.gif
unite_blue.png
Security Administrator | Sysnative Windows Update Senior Analyst | Malware Hunter | @SecurityAura
My timezone UTC-05:00 (East. Coast). If I didn't reply to you within 48 hours, please send me a PM.


#5 alpha_3rewqr

alpha_3rewqr
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:07:36 AM

Posted 30 June 2016 - 10:17 PM

Hi

 

Heres what the taskbar looks like when I start Google Drive using taskscheduler.

 

http://imgur.com/FUboy7i

 

Also googledrive doesnt shut off, even though I have set it to turn off after 4 hrs. I started the task manually using the task scheduler, to check whether it will run around 9 hrs back.

http://imgur.com/Wma9KnR

 

Heres what it looks like when I start it using the google drive icon:

http://imgur.com/vTN7dSy

 

I dont know whether its actually syncing or not either.



#6 FreeBooter

FreeBooter

  • Members
  • 3,137 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Turkey - Adana
  • Local time:05:36 PM

Posted 30 June 2016 - 11:02 PM

Add this to Task Scheduler click Actions tab click Edit button and Add arguments (optional) input box  you need to add /Autostart parameter for "C:\Program Files (x86)\Google\Drive\googledrivesync.exe" executable file. Create a batch script to terminate googledrivesync.exe executable file and schedule this batch script to run at time when you want Google Drive to terminate. Open Notepad and paste/copy below command and save it as EndGoogleDrive.bat batch file.

@Echo Off & Cls

Taskkill /im googledrivesync.exe /t /f

Exit

Posted Image


#7 RolandJS

RolandJS

  • Members
  • 4,539 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Austin TX metro area
  • Local time:08:36 AM

Posted 30 June 2016 - 11:50 PM

Gibson's wizmo.exe contains a long list of switches including a couple of OFF/Shutdown switches. However, what I use presently is Wise Automatic Shutdown program -- it can be set to log off, restart, shutdown according to a countdown or a specific time or a specified length of time. I'm not sure if the above-mentioned can help you or not.


"Take care of thy backups and thy restores shall take care of thee."  -- Ben Franklin revisited.

http://collegecafe.fr.yuku.com/forums/45/Computer-Technologies/

Backup, backup, backup! -- Lady Fitzgerald (w7forums)

Clone or Image often! Backup... -- RockE (WSL)


#8 itfidds

itfidds

  • Members
  • 1 posts
  • OFFLINE
  •  
  • Local time:03:36 PM

Posted 29 November 2017 - 06:16 AM

Hi,

 

I know this post is a little old but, having searched Google, it still seems a relevant subject.

 

Having satellite internet, more often than not, unlimited downloads/uploads is restricted to 'out of hours' such as 00:00 to 06:00.

 

To start and stop GoogleDrive I have setup two tasks in Windows scheduler.

 

I have exported them here in case they may be useful to others.

 

Unfortunately I cannot attach the xml files so have posted the code below...

 

Start

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2017-11-29T11:22:41.3668978</Date>
    <Author>PC_Name\Username</Author>
    <URI>\Start Google Drive</URI>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2017-11-01T00:00:01</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-2431380585-31526009-1606420346-1001</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>true</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT8H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>"C:\Program Files (x86)\Google\Drive\googledrivesync.exe"</Command>
      <Arguments>/autostart</Arguments>
    </Exec>
  </Actions>
</Task>

Stop

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2017-11-29T11:11:31.0396296</Date>
    <Author>PC_Name\Username</Author>
    <URI>\Stop Google Drive</URI>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2017-11-01T05:45:00</StartBoundary>
      <ExecutionTimeLimit>PT30M</ExecutionTimeLimit>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-2431380585-31526009-1606420346-1001</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>true</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>taskkill</Command>
      <Arguments>/im googledrivesync.exe /t /f</Arguments>
    </Exec>
  </Actions>
</Task>

To use these copy the code and paste in to files called "Start Google Drive.xml" and "Stop Google Drive.xml" respectively.

Edit the section "Author" and change the details to reflect your computer name and username.

At the same time you can change the start and stop times.

In task scheduler select 'Import' to create the tasks and that should be that!

 

Cheers






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users