Medium
Operating Systems
✓ Solution Verified by Community (0+ upvotes)
How to fix error error-not-locked in Windows 11
ERROR_NOT_LOCKED = 158
Fix based on community reports and expert analysis. Last verified: 2026-08-12
· How we verify fixes
| Error Code | error-not-locked |
|---|---|
| Affected System | Windows 11 (Microsoft) |
| Difficulty | Medium |
| Estimated Time | 30 min |
| Requires Admin Rights | ⚠️ Yes |
| Requires Reboot | 🔄 Yes |
Solution Steps
- 1 First, identify which application is causing the error. Check the Windows Event Viewer: press Windows key + X, select 'Event Viewer', go to 'Windows Logs' > 'Application', and look for error entries around the time the error occurred. Note the source and details. This helps you know which program to focus on.
- 2 Update the problematic application. Visit the software vendor's website and download the latest version. Many bugs related to locking are fixed in updates. If it's a game, update it through the game launcher (e.g., Steam, Epic Games).
- 3 If the error is system-wide, run the System File Checker. Press Windows key + R, type 'cmd', press Ctrl+Shift+Enter to run as administrator. Type 'sfc /scannow' and press Enter. This repairs corrupted system files that might be causing improper locking behavior.
- 4 Check for driver updates, especially for storage controllers. Press Windows key + X, select 'Device Manager', expand 'Storage controllers', right-click on each, and select 'Update driver'. Outdated storage drivers can cause file locking issues.
- 5 If the error persists, perform a clean boot to rule out software conflicts. Press Windows key + R, type 'msconfig', press Enter. Go to 'Services', check 'Hide all Microsoft services', click 'Disable all'. Go to 'Startup' and click 'Open Task Manager', disable all startup items. Restart. If the error disappears, re-enable services and startup items one by one to find the culprit.
🔍 Didn't work? Enter your GPU and CPU for hardware-specific advice:
🔧 Still having issues?
Describe your exact problem to Error Buddy and get a personalized fix in seconds.
🛠️ Try Error Buddy — It's Free