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
- 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").
-
For hibernation mode only**, use this command:
shutdown /hFor immediate force shutdown (replaces hibernation)**, use:
shutdown /f /hVerify active user processes before shutting down. Hibernation preserves all open apps in RAM; force shutdown terminates all processes abruptly.
-
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 RDPssfirst 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 administratorfrom the Start Menu. -
Using a non-PowerShell context**: CMD alone lacks some hibernation utilities (e.g., PowerShell’s
Get-Sleepcan’t replaceshutdown). Always use an elevated terminal. -
Ignoring active services**: Running
shutdown /hwhile 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 highestThis 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 return0; if1, runfsutil behavior set DisablePagingAroundHive 0.) -
Use TASKLIST to inspect processes**: Before shutting down, list active processes:
tasklistKill critical processes if needed withtaskkill /PID [PID] /F.
Troubleshooting
-
Error: "The file system does not support hibernation"**:
- Check for a valid hibernation file (
hiberfil.sys) inC:\. If missing, enable it via:powercfg /h on - Ensure no disk encryption (BitLocker) or full-disk encryption is active before shutdown. Disable it or initialize:
bdehdcf(for BitLocker) or check disk permissions.
- Check for a valid hibernation file (
-
Command fails with "Not enough memory"**:
- Free up RAM by closing background apps or launch
taskmgrto see usage. - Hibernation requires available RAM equal to the system’s total (e.g., 8GB PC needs 8GB free). If low, use
shutdown /finstead.
- Free up RAM by closing background apps or launch
-
System won’t hibernate at all**:
- Run this to check event logs for errors:
eventvwr.msc→ Windows Logs → System. - If errors appear, disable a conflicting service (e.g.,
sc stop svchost.exe /ffor critical services). - Test with a clean boot:
msconfig→ Select "Selective startup" → Uncheck "Start programs" and "Load startup items."
- Run this to check event logs for errors:
Frequently Asked Questions
Can I hibernate a Windows 11 PC without a GUI?
Yes, the commandshutdown /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. Usebcdedit /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 withtaskkill /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:- Pause updates temporarily:
net stop wuauservreg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableOSUpgrade /t REG_DWORD /d 1 /f - Wait until updates finish before rebooting.