Re: logoff user & go to sleep

Home Forums Scripting General Scripting logoff user & go to sleep Re: logoff user & go to sleep


Rems
Moderator
#228426

Re: logoff user & go to sleep

igor7;283024 wrote:
Thanks, Rems!!
This solution working perfectly on Windows 7 Ent/Pro. I’m also searched for something similar…
Just one remark… If in the system power plan enabled hibernation, the command SetSuspendState 0,1,0
will cause computer hibernate instead of sleep. In order to force it sleep after log off, hibernation should be turned off. Reference:
http://msdn.microsoft.com/en-us/library/aa373201.aspx
Alternatively it is possible to use NirCmd.exe tool for forcing computer to go into standby mode even when hibernation is enabled:
http://www.nirsoft.net/utils/nircmd.html

Thank you igor7 for the additional information.

/Rems