How to see from commandline (!!!) if hibernation is on or off?


  1. Posts : 244
    win7pro 64bit
       #1

    How to see from commandline (!!!) if hibernation is on or off?


    How can users check from commandline (!!!) if hibernation is currently on or off?

    When I search through the Internet then thousands of articles describe how to turn it e.g. on e.g. by

    powercfg -H on

    But what if I just want to let Win just show the current state WITHOUT to change it?

    Is there really no way of just checking it from command line (NOT by Control Panel)?

    Peter
      My Computer


  2. Posts : 35
    Windows 7 Professional x64
       #2

    I have an SSD therefor I do not use Hibernation. It's a horrible idea.

    To find out if the feature is enabled, the file must exist, hiberfil.sys

    To find out if the file exists, its a hidden file, try


    Or try
    Code:
    assoc C:\hiberfil.sys
    then try it with quotes "C:\hiberfil.sys".
      My Computer


  3. Posts : 244
    win7pro 64bit
    Thread Starter
       #3

    This is excatly NOT true!

    An existing hiberfil.sys can be an old fragment file which is not cleaned up. Or it was restored from a previous file/folder tree restoration.

    Furthermore I have seen three month old hiberfil.sys files although the system was reboot a couple of times in the meantime.
    Very strange!

    So again: I search for a cmdline hibernation state detection command
      My Computer


  4. Posts : 35
    Windows 7 Professional x64
       #4

    pstein said:
    This is excatly NOT true!

    An existing hiberfil.sys can be an old fragment file which is not cleaned up. Or it was restored from a previous file/folder tree restoration.

    Furthermore I have seen three month old hiberfil.sys files although the system was reboot a couple of times in the meantime.
    Very strange!

    So again: I search for a cmdline hibernation state detection command
    The possibility you described is slimmer than you think. If Hibernation was turned off properly, the hiberfil.sys will have been removed along with it.

    I've read deeper into the help file. Here you go . Stay thirsty, my friend.

      My Computer


  5. Posts : 6,285
    Windows 10 Pro X64
       #5

    powercfg /query will also tell you. Look for the data after:

    Power Setting GUID: 9d7815a6-7ee4-497e-8888-515a05f02364 (Hibernate after)
    GUID Alias: HIBERNATEIDLE
    Minimum Possible Setting: 0x00000000
    Maximum Possible Setting: 0xffffffff
    Possible Settings increment: 0x00000001
    Possible Settings units: Seconds
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000
    Both A/C and DC are set to 0 which means Hibernate is disabled.
      My Computer


  6. Posts : 1
    11
       #6

    cmd : powercfg –availablesleepstates
      My Computer


  7. Posts : 1
    Windows 10
       #7

    pstein said:
    How can users check from commandline (!!!) if hibernation is currently on or off?

    When I search through the Internet then thousands of articles describe how to turn it e.g. on e.g. by

    powercfg -H on

    But what if I just want to let Win just show the current state WITHOUT to change it?

    Is there really no way of just checking it from command line (NOT by Control Panel)?

    Peter
    if you visit your Shut Down menu, then right click the arrow to the right of that word, a pop-up menu appears. If Hibernate shows up on that menu, it's enabled/turned on; if it's absent from that menu, it's disabled/turned off.

    or just enter this command to Powershell
    HTML Code:
    $hibernation = Get-CimInstance -ClassName Win32_PowerManagementCapabilities | Select-Object HiberFilePresent
    
    if ($hibernation.HiberFilePresent -eq $true) {
        Write-Host "Hibernation is on"
    } else {
        Write-Host "Hibernation is off"
    }
      My Computer


  8. Posts : 16,161
    7 X64
       #8

    powercfg /a
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:22.
Find Us