ERROR_LOCK_VIOLATION 0x80070021

Error code 33 · HRESULT 0x80070021

WINDOWS

The process cannot access the file because another process has locked a portion of the file.

Windows troubleshooting diagram: Device Manager warning and a system file scan
Windows errors: check drivers, system files and Event Viewer, in that order.

What it means

ERROR_LOCK_VIOLATION is a Windows error code (system error 33, returned as HRESULT 0x80070021) reported by Windows. Its official message is: “The process cannot access the file because another process has locked a portion of the file.”

How to fix ERROR_LOCK_VIOLATION

  1. Run the affected program as administrator (right-click → Run as administrator)
  2. Check permissions on the target resource: Properties → Security → your account
  3. Check Event Viewer → Windows Logs → Security for the matching audit entry

Related errors

Source: Microsoft WinError.h

Last updated: