STATUS_WAS_UNLOCKED (0X40000017) – The Real Fix
Status_Was_Unlocked means a drive or file lock got released mid-op. Here's how to stop it from popping up.
You're copying a file, and Windows throws STATUS_WAS_UNLOCKED (0X40000017) at you. That stinks. Let's get it fixed so you can get back to work.
Quick Fix: Disable Fast Startup or Eject Properly
This error nearly always happens because a drive (USB, external HDD, or even a BitLocker-encrypted internal drive) was still marked as 'locked' when you tried to access it. Windows's Fast Startup feature is the main culprit—it hibernates the system, leaving the drive lock state in limbo. Had a client last month whose entire print queue died because of this exact issue on a USB drive.
- Disable Fast Startup (Windows 10/11)
Open Control Panel → Power Options → Choose what the power buttons do. Click Change settings that are currently unavailable, then uncheck Turn on fast startup (recommended). Save changes, restart. - Eject USB drives properly
Before unplugging, right-click the drive in File Explorer and select Eject. Skipping this leaves the lock flag set. - Run disk check if the error persists
Open Command Prompt as admin, typechkdsk /f X:(replace X with the drive letter). Say yes to schedule it on next reboot.
Why This Works
STATUS_WAS_UNLOCKED (0X40000017) means the NTFS file system detected that a previously locked volume was unlocked during an operation. Fast Startup doesn't fully unmount drives during shutdown—it saves state, then on boot, the lock status is inconsistent. Disabling it forces a clean unmount. For USB drives, not using 'Safely Remove Hardware' leaves the drive in a semi-locked state; the next time you plug it in, Windows thinks it's still locked, and any write operation triggers the error. The disk check repairs any orphaned lock metadata.
Less Common Variations
- BitLocker drives: If you have BitLocker enabled, the drive might be auto-unlocked but the lock state hasn't synced. Run
manage-bde -status X:to check. If it shows 'Unlocked' but the error still shows, suspend and resume BitLocker:manage-bde -protectors -disable X:thenmanage-bde -protectors -enable X:. - Network drives: On mapped network drives, this error can pop up if the server's session lock gets dropped. Disconnect and remap:
net use X: /deletethennet use X: \\server\share. - Virtual machine drives (Hyper-V/VirtualBox): If you're running a VM that uses a VHD/VHDX on an external drive, the host's Fast Startup can confuse the guest's lock state. Disable Fast Startup on the host and set the VM's drive to 'Fixed size' instead of 'Dynamically expanding'.
Prevention Tips
- Always use 'Safely Remove Hardware' for USB drives. It's not a suggestion—it's the only way to clear the lock flag.
- Keep Fast Startup disabled if you regularly use external drives or BitLocker. The boot time difference is negligible on SSDs.
- Schedule regular disk checks via Task Scheduler:
schtasks /create /tn "DiskCheck" /tr "chkdsk /f C:" /sc weekly /st 02:00. - Update your storage drivers—especially USB controllers and SATA AHCI drivers. Outdated drivers can mishandle lock commands.
Bottom line: STATUS_WAS_UNLOCKED is Windows telling you it didn't cleanly manage a lock. Disable Fast Startup and eject properly. That'll kill 90% of cases. The rest are BitLocker or drive corruption—easy to fix once you know where to look.
Was this solution helpful?