Is it possible to delay the default shutdown from Windows?

I installed BitTorrent Sync and I want to give it 30 minutes to finish syncing when I go away from my computer and then shut down. I know this is possible using

shutdown -s -t <seconds>

but is it possible to do this by default?

  • No; Because in most cases Windows 8.1 does not actually shutdown but does a Hyrbrid shutdown. Why don't you just make it a task which happens before the users is logged out? That would be the proper way to prevent a shutdown normally.
    – Ramhound
    May 22 '14 at 11:11
  • I believe the easiest way for you to achieve this is be to run your shutdown command through a batch script. Start Notepad. Enter shutdown -s -t <seconds>. Save the file as "Delayed Shutdown.bat" and double click the newly created batch script whenever you want to shutdown your computer.
    – Vinayak
    May 22 '14 at 11:28
  • @Ramhound I'm talking about actual shutdown. I'll look into making a scheduled task, thanks for the tip. May 22 '14 at 17:19

You can just go to utorrent advanced settings and add 'Run program when a torrent finishes'. As you suggested, create a bat file.

Added: I apologize, I did not read your question right. Now, since you want to do something that is not exactly part of the solution, you can use an API to communicate with the program (register to get a key). http://www.bittorrent.com/sync/developers/api

I think you can query the sync status, and when the status.isSynced (not actual function) then you can send a PC shutdown command.

  • If you'd read my question with more care, you'd see I'm not talking about uTorrent, I'm talking about BitTorrent Sync, which is something totally different. May 22 '14 at 17:16
  • pardon, added something
    – Andrew
    May 22 '14 at 17:24
  • Thanks for that, but I'm not sure how the API key will change the default behaviour of Window's shutdown command. May 22 '14 at 17:27
  • You can have a script that works on the background. API will be checking that sync has been completed. As soon as it is completed, you don't need to wait for another 30 minutes; so the script will proceed with the normal shutdown. Or you can set a shutdown timeout/delay in the script as well.
    – Andrew
    May 22 '14 at 17:30

I don’t know of a setting/process but this should work. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet and click on the Control folder. Look for WaitToKillServiceTimeout, right-click it and choose Modify. I suspect it’s stored in milliseconds, in which case 3600000 represents 1 hour.

Test it first, set to, say, 5 minutes (300000).

  • The WaitToKillServiceTimeout value "[d]etermines how long the system waits for services to stop after notifying the service that the system is shutting down. [...] If all services stop before this value expires, the system shuts down; it does not wait for this value to expire." Source
    – and31415
    May 22 '14 at 12:45
  • Fair enough - I figured if btsync was configured to run as a service and was busy, this would give the required delay.
    – Fazer87
    May 22 '14 at 12:48
  • @Fazer87 No, this is not the case. It's running as an application (possibly with background service) but it will shut down as soon as the operating systems tells it to (normal shutdown behaviour). Therefore I want Windows to delay the shutdown command with 30 minutes. May 22 '14 at 17:18
  • Also, I'm guessing you just copied this answer from the page I'm currently looking at. May 22 '14 at 17:26
  • probably, but it seemed to work for me with uTorrent as a service instead of an app, so i figured it would be transferrable
    – Fazer87
    May 23 '14 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.