Why you're seeing this error
I know this error is infuriating. You shut down your PC normally, or maybe you let it hibernate. Then next boot, you're stuck with a blue screen saying 0x00000313. The message says the hibernation file is invalid and should be abandoned.
This happens most often after a Windows update that crashes during hibernation, or if your laptop battery dies while it's sleeping. The file hiberfil.sys gets corrupted. The good news? You don't need to reinstall Windows.
Fix 1: Clear the hibernation file with a command (30 seconds)
This is the simplest fix. It works for 9 out of 10 people I've helped. You'll run a single command to delete the corrupted hibernation file.
- Boot your PC. When you see the error, let it fail to start normally.
- After the automatic repair screen shows up, click Advanced options.
- Go to Troubleshoot → Advanced options → Command Prompt.
- At the command prompt, type:
Press Enter. This deletes the corruptedpowercfg /hibernate offhiberfil.sysfile. - Type
exitand press Enter. Then click Continue to restart Windows.
If Windows boots normally, you're done. If you want to use hibernation again later, just run powercfg /hibernate on from an admin Command Prompt. But skip that for now — let's make sure your PC is stable first.
Fix 2: Disable hibernation via Registry (5 minutes)
If the command didn't work, the file might be locked by Windows. We'll go through the Registry to force-disable it. Be careful — Registry changes can mess things up if you don't follow exactly.
- Boot from a Windows installation USB or recovery drive. If you don't have one, create it on another PC using the Media Creation Tool.
- Choose your language and click Next. Then click Repair your computer at the bottom left.
- Go to Troubleshoot → Advanced options → Registry Editor.
- In Registry Editor, select
HKEY_LOCAL_MACHINEfrom the left pane. - Click File → Load Hive. Navigate to your Windows drive (usually
C:\Windows\System32\config), select the fileSYSTEM(no extension), and click Open. - When asked for a key name, type
TempHiveand press Enter. - Go to
HKEY_LOCAL_MACHINE\TempHive\ControlSet001\Control\Power. - Double-click HibernateEnabled on the right. Change the value from
1to0. Click OK. - Go back to
HKEY_LOCAL_MACHINE\TempHive, select it, click File → Unload Hive. Confirm. - Close Registry Editor, restart your PC, and remove the USB.
This kills hibernation completely. Your PC will boot normally. If you want hibernation back later, just set the value back to 1 the same way.
Fix 3: System File Checker and CHKDSK (15+ minutes)
This is the nuclear option. Use this when the error keeps coming back after hibernation is off. It means the corruption spread to system files.
- Boot into Command Prompt as described in Fix 1 (Advanced options → Command Prompt).
- Run:
Replacesfc /scannow /offbootdir=C:\ /offwindir=C:\WindowsC:with your Windows drive letter if different. This checks system files. - After SFC finishes, run:
Press Y if asked to schedule it, then typechkdsk C: /f /rexitand restart. The scan will run on next boot and fix disk errors.
This can take 30 minutes on a slow drive. Let it finish. When it's done, your PC should boot clean.
One more thing: If you're on a laptop and this happens often, check your power plan settings. Go to Control Panel → Power Options → Change plan settings → Change advanced power settings. Under Sleep, set Hibernate after to Never. Some laptops have buggy firmware that corrupts the file. I've seen this on Dell XPS 13 units from 2020.
That's it. Start with Fix 1. Most of you won't need the other two. If none work, you might have a failing drive — back up your data and run wmic diskdrive get status in Command Prompt to check.