We can hibernate a Windows computer from command prompt using shutdown command. Shutdown command has various switches for different operations like shutdown, reboot, hibernate, log off etc. The command for hibernating windows computer is given below.
shutdown /h
This works on all Windows versions – XP, Vista, Windows 7, Server 2003 and Server 2008.
Shutdown can be used in a batch script file also. Once the command is triggered, we can’t abort the hibernation operation.
Related Posts:
Not true for Windows XP!
%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
Can every user run this command? I am getting ‘access denied’ error.
Yes/all users can use this command through cmd If you can’t check you system meet the requirements to hibernate
if access denied then try to open CMD as Adminstartor
start > search for cmd > right click on Command Prompt > Run As Administrator
and try to type the command again ;)
The command [shutdown /h] did not work on my XP as well. However the command
[%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState] works just fine (as of now [10/27/2016]). I login as the admin all the time on my home PC. Thanks!
Cool it’s working on windows 10
The problem is not the code you should change some settings to allow this work.i have done it before so I don’t really remember what the setting was just Google it good luck.
It also works on windows 10.
can a timer be put? like when we do shutdown -s -t xxx
doing shutdown -h -t is not working. any way to put a timer?
yes shutdown -s -t /h 2600
timeout [seconds] && shutdown /h
Works fine on WIN 10.
to add a timer, create a bat script as below, change the timeout value as you like. Below example is for 60 seconds
——————
timeout 60
shutdown /h /f