3

I need a hibernate shortcut on the desktop of my computer.
I found a tutorial which works good (code is below). The only problem is that I need to delay the hibernate.

C:\Windows\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0

The reason is because I use remote desktop to shut down, and if I don't disconnect the remote desktop first I have to wait for it to time out next time I want to connect.

So a delay of say 10 seconds should be good enough to be able to disconnect.

I found this related question but when I use that, it shuts down completly. I need to make the computer hibernate so that I can start it again with WOL.

Any ideas on how to delay the hibernate?

Andreas
  • 270

1 Answers1

3

I need to delay the hibernate.

You can use timeoutfor this.

Use the following batch file (and point your shortcut to the batch file):

@echo off
rem delay for 10 seconds
timeout 10 /nobreak
rem hibernate
rundll32.exe powrprof.dll,SetSuspendState 0,1,0

DavidPostill
  • 162,382