≡ Menu

How to hibernate Windows from command line

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:

Enable hibernation in Windows

 

14 comments… add one
  • CleverDick

    Not true for Windows XP!

  • CleverDick

    %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

  • Gaurav

    Can every user run this command? I am getting ‘access denied’ error.

    • Masterolic

      Yes/all users can use this command through cmd If you can’t check you system meet the requirements to hibernate

  • billlo

    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 ;)

  • Raman

    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!

  • John Henry Gaspay

    Cool it’s working on windows 10

  • Steve

    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.

  • Justin Goldberg

    It also works on windows 10.

  • shashwat

    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?

    • nhyta

      yes shutdown -s -t /h 2600

    • yeahah

      timeout [seconds] && shutdown /h

  • Luc

    Works fine on WIN 10.

  • Emrah Ozbekar

    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

Leave a Comment