Tested on one machine with Win7+Win10 (dual boot) with hiberfil.sys and pagefile.sys OFF and a second Win7 machine with those ON. Admin or not made no difference.
This has been discussed already in the archived forum, but no solution was found. I can't wrap my head around this so I'm looking for help here.
These are the programs and methods I've tested divided by which was faster and which was slower.
- Physical power button (if you "Change what the power buttons do" from the power options into Sleeping instead)
- Windows regular Start button -> Sleep
- Open-Shell Start button -> Sleep
- PsShutdown -d -t 0
- Nircmd standby
- wizmo standby
- My own Assembly program using SetSuspendState
- My own Assembly program using SetSystemPowerState (SeShutdownPrivilege required)
- AutoHotkey calling CMD calling PowerShell calling Application.SetSuspendState (lol):
- AutoHotkey calling DllCall("PowrProf\SetSuspendState", "int", 0, "int", 1, "int", 1) (from the Shutdown documentation)
- AutoHotkey calling DllCall("Kernel32\SetSystemPowerState", "int", 1, "int", 1) (SeShutdownPrivilege required)
- rundll32.exe Powrprof.dll,SetSuspendState (not recommended, Standby only works if Hibernation is disabled)
powercfg -a to check your available power states
powercfg -h off to disable hibernation (S4)
TL;DR putting the PC on standby using AHK is slow for some unknown reason, how do I make it fast like other programs?