Hibernating Windows 11 via the command line lets you save your session state cleanly without a GUI shutdown, ideal for servers, remote systems, or power-saving in headless setups. Simply run the `shutdown` command with the `/h` flag—no mouse or screen needed. All open processes freeze in memory, and the system wakes from hibernation on the next power-on. If you need to jump straight to power-off instead, use `/f` (force shut down) instead. This avoids any potential file corruption and is faster than a regular sleep state.

What You'll Need

  • Windows 11 PC with administrative permissions for the command prompt
  • An open PowerShell or Command Prompt window (native CMD or PowerShell) as admin
  • Basic familiarity with typing commands (e.g., `/h` or `/f` flags)

Step-by-Step

  1. Open an elevated command prompt or PowerShell. Press Win + X, select Terminal (Admin) or Windows Terminal (Admin), then choose Command Prompt or PowerShell. Log in with an administrator account if prompted. Labels may differ slightly by version or region (e.g., some versions show "Windows Terminal" under "All Apps").
  2. For hibernation mode only**, use this command: shutdown /h

    For immediate force shutdown (replaces hibernation)**, use: shutdown /f /h

    Verify active user processes before shutting down. Hibernation preserves all open apps in RAM; force shutdown terminates all processes abruptly.

  3. Wait for the system to hibernate (or shut down instantly if `/f` was used). A confirmation prompt may appear if the command is run interactively. Remote sessions (RDP) will freeze in hibernation mode. For RDP, use sc stop RDPss first if needed—this kills the Remote Desktop service.

Common Mistakes

  • Running as non-admin**: Hibernation requires elevated permissions. If you get an error like "Access Denied," restart the command prompt as admin or use Run as administrator from the Start Menu.
  • Using a non-PowerShell context**: CMD alone lacks some hibernation utilities (e.g., PowerShell’s Get-Sleep can’t replace shutdown). Always use an elevated terminal.
  • Ignoring active services**: Running shutdown /h while services like BitLocker or disk encryption are active may trigger errors. Close critical services or initialize them first: net stop BitLocker (if applicable) or wait for them to auto-hibernate.

Tips

  • Schedule hibernation**: Add this to Task Scheduler for auto-hibernation: schtasks /create /tn "HibernateOnBoot" /tr "shutdown /h" /sc onlogon /rl highest This runs the hibernation command when the PC boots. Test first with a manual run.
  • Restore from hibernation**: To wake from hibernation, simply power on the PC. Windows resumes from the saved session.
  • Check hibernation status**: Verify the file system supports hibernation first: fsutil behavior query DisablePagingAroundHive (Should return 0; if 1, run fsutil behavior set DisablePagingAroundHive 0.)
  • Use TASKLIST to inspect processes**: Before shutting down, list active processes: tasklist Kill critical processes if needed with taskkill /PID [PID] /F.

Troubleshooting

  1. Error: "The file system does not support hibernation"**:
    1. Check for a valid hibernation file (hiberfil.sys) in C:\. If missing, enable it via: powercfg /h on
    2. Ensure no disk encryption (BitLocker) or full-disk encryption is active before shutdown. Disable it or initialize: bdehdcf (for BitLocker) or check disk permissions.
  2. Command fails with "Not enough memory"**:
    1. Free up RAM by closing background apps or launch taskmgr to see usage.
    2. Hibernation requires available RAM equal to the system’s total (e.g., 8GB PC needs 8GB free). If low, use shutdown /f instead.
  3. System won’t hibernate at all**:
    1. Run this to check event logs for errors: eventvwr.msc → Windows Logs → System.
    2. If errors appear, disable a conflicting service (e.g., sc stop svchost.exe /f for critical services).
    3. Test with a clean boot: msconfig → Select "Selective startup" → Uncheck "Start programs" and "Load startup items."

Frequently Asked Questions

Can I hibernate a Windows 11 PC without a GUI?

Yes, the command shutdown /h works even on headless machines (servers, laptops without displays). It saves RAM state to hiberfil.sys and wakes on next boot.

What happens if I hibernate while a driver is locked?

Hibernation freezes the system, but if a critical driver (e.g., GPU, storage) is unloaded, Windows may fail to resume. Use bcdedit /set hiberfiluser 0 to disable hibernation temporarily or check driver compatibility.

Is there a way to hibernate only specific apps?

No, hibernation preserves the entire session state. Kill open apps manually with taskkill /IM "app.exe" /F before shutting down, but this limits what’s saved.

Why does my hibernation sometimes fail on Windows Update?

Windows Update may pause hibernation for updates. Try:
  1. Pause updates temporarily: net stop wuauserv reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableOSUpgrade /t REG_DWORD /d 1 /f
  2. Wait until updates finish before rebooting.

Can I schedule hibernation via Task Scheduler?

Yes, use the scheduled task method shown in the Tips section. Test manually first to avoid accidental shutdowns.

Will hibernation work on a USB stick or SSD?

Yes, if the disk is formatted as NTFS and the system allows it. Avoid SSDs with TRIM disabled—hibernation can damage them.