ERROR_LOCK_VIOLATION: 11 Best Fixes

Reading time icon 9 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

error_lock_violation
XINSTALL BY CLICKING THE DOWNLOAD FILE
A message from our partner

For fixing Windows errors, we recommend Fortect:

Fortect will identify and deploy the correct fix for your Windows errors. Follow the 3 easy steps to get rid of Windows errors:

  • Download Fortect and install it on your PC
  • Launch the tool and Start scanning your PC for Windows errors
  • Right-click on Start Repair to deploy the right fix for each error encountered during the scan
Download Now Fortect has been downloaded by 0 readers this month, rated 4.6 on TrustPilot

Do you keep seeing ERROR_LOCK_VIOLATION when trying to access a file?

The Windows file system uses a robust caching system to address multitasking. However, due to a bug in the early editions of Windows 7, Windows Vista, Windows Server 2008, and Windows Server 2008 R2, you might get the following error:

  • ERROR_LOCK_VIOLATION: 33 (0x21) The process cannot access the file because another process has locked a portion of the file.

Occasionally, there are reports of the same issue in modern versions, like Windows 10 and 11.

How To Fix ERROR_LOCK_VIOLATION

To help you resolve this pressing issue, I’ve listed the tried and tested methods below starting with the easiest ones:

Basic Troubleshooting

  • Restart the system: A simple reboot or force restart might also fix the issue.
  • Make a copy of the source file: Create a copy of the source file in a different directory. Then, try to access the file using the relevant software.
  • Close all open applications: Use the Windows Task Manager to close all open apps to rule out any software conflict. Third-party apps will show up below the Apps section of Processes Name.
Task manager Apps
  • Check for background processes: Also, go through the Background processes section and find if any third-party apps are running except for Windows processes.
Task manager background
  • Briefly disable the antivirus: Deactivate real-time monitoring tools or the built-in Windows Security. For the built-in antivirus, go to Settings > Update & Security > Windows Security > Virus & threat protection > Manage settings > Turn off Real-time protection. Don’t forget to enable it again when testing is over.
Real-time protection

Update Windows OS to Its Latest Edition

For Windows 10 and 11 PCs, follow these steps:

  1. Press Windows + I to open Settings.
  2. Click on the Update & Security menu on the left-side panel.
  3. Now, go to Windows Update and hit Check for updates or Resume updates.
Windows update

For older Windows PCs, try these steps instead:

  1. Hit the Start menu button and select the All Programs option.
all programs
  1. Then, click on the Windows Update menu.
windows update vista
  1. Click on the Check for updates button in the left-side panel.
  2. Select View available updates and check if the Service Pack for Microsoft‌ Windows update is available.
  3. Click on the Install button if visible.
  4. Follow onscreen instructions to complete updating to the latest Service Pack edition.

If you don’t see the above update option, you can manually download the appropriate Service Pack for your Windows OS from the Microsoft Download Center. Since Microsoft has stopped supporting older versions, you might have to install Service Packs manually.

You can also check out the Microsoft Update Catalog portal for more updates.

Use the Sysinternals Process Explorer Tool

Sometimes, Windows Task Manager can’t completely stop conflicting apps. Hence, ERROR_LOCK_VIOLATION will still show up even if you’ve closed a few of them.

You can use the Sysinternals Process Explorer instead. Here’s how:

  1. Download Process Explorer from the official Microsoft website.
  2. Unzip the content in a dedicated folder.
  3. Run the procexp EXE file if your PC is a 32-bit system.
  4. If it’s a 64-bit machine, run the procexp64 EXE file.
Process Explorer
  1. Press Ctrl + F and type in the complete file name with the extension and hit Enter.
Search process
  1. You should see a list of conflicting processes.
  2. If you don’t see anything as shown in the below screenshot, press Ctrl + Shift + F.
  3. This will launch the Process Explorer Search dialog box.
Process Explorer Search
  1. In the Handle or DLL substring field, again type in the problematic file name.
  2. Hit Search. Wait up to a minute for the table to populate.
  3. You’ll now see the list of conflicting apps.
Handle or DLL substring
  1. Close those from the home screen of Process Explorer. Right-click on the target and select Kill Process.
Kill Process

Run a Disk Error Check

  1. Press Windows + E to open the File Explorer.
  2. Click on This PC in the left-side navigation panel.
  3. Select the first drive, like C: and right-click.
  4. Choose Properties from the context menu.
  5. Navigate to the Tools tab in the Properties dialog box.
  6. Click on the Check button below the Error checking section.
Tools check
  1. The Error Checking dialog box will show along with a progress bar.
Error checking scanning
  1. Allow the process to complete.
  2. Now, repeat these steps for the rest of the drives on your PC.

Scan for Malware in Offline Mode

  1. Open the Windows Settings app by pressing the Windows key and the I key simultaneously.
  2. Click on Update & Security at the bottom.
  3. Now, select Windows Security from the list of options in the left-side navigation pane.
  4. Click on Virus & threat protection on the right side.
Virus & threat protection
  1. Select the Scan options button below Quick scan.
scan options
  1. Then, scroll down to the Advanced options and click on it.
  2. Select the Microsoft Defender Offline scan option, and click on the Scan now button below it.
Microsoft Defender Offline
  1. Windows Defender will now perform a thorough malware scan while your computer is in offline mode.

Change File Security Permissions

Are you seeing the ERROR_LOCK_VIOLATION error in a Workgroup/ Homegroup network, shared drive, or non-administrator Windows account? Try allowing access to the file for all collaborators or reducing the security policies by following these steps:

  1. Navigate to the problematic file, select it, and right-click.
  2. Select Properties from the context menu.
properties box
  1. Go to the Security tab of the Properties dialog box.
  2. You’ll see the users in the Group or user name list.
  3. Select the target user and hit the Edit button.
Edit properties
  1. Again choose the same user name in the Permissions for dialog box.
  2. Checkmark all the boxes below the Allow section.
  3. Click Apply and OK on all the dialog boxes to make the changes effective.
Allow all

Fix Hardware, Driver, and Firmware Issues

It might be possible that the disk drive isn’t installed appropriately or it’s facing connectivity issues. So, shut down the PC and open the PC case. Unplug the power and data cable from the HDD or SSD. If it’s an NVMe M.2 SSD chip, remove it from its PCIe slot.

Snuggly connect the cables back to the hard disk or solid-state drive. For the NVMe chip, reseat it appropriately. Power on the PC and check if the issue resurfaces again or not.

Also, ensure that the SATA HDD drivers of the Windows PC are updated by performing these steps:

  1. Right-click on the Start menu flag and click on Device Manager from the context menu.
power user
  1. On Device Manager, extend the Disk drives tree and right-click on a disk drive.
  2. Select Update driver from the context menu.
update driver
  1. Choose Search automatically for driver in the next dialog box that shows up.
  2. Wait for Windows to update the drivers either from Microsoft’s database or other official online sources.
  3. Ensure that the device is connected to the internet the whole time.

If the internal storage is an SSD or NVMe SSD chip, you can install the manufacturer’s SSD management software. For example, I’m using NVMe M.2 drive from Crucial so I’ve installed and tested the method using the Crucial Storage Executive app.

Check if there are any updates available for the hardware firmware.

firmware

Apply the update and restart the PC.

Run the SFC and DSM Scans to Fix the Windows File System

If the Windows file system is compromised, the following scans will reveal and fix that:

Running an SFC Scan

  1. Open the Power User menu by right-clicking on the Start menu button.
  2. Select Terminal (Admin) to open Windows PowerShell with administrator privileges.
  3. Enter sfc /scannow in the console and hit Enter.
sfc scan
  1. You don’t need to do anything if you see any of the following outcomes:
    • No integrity violations found.
    • Integrity violations found and repaired.
  2. However, if you see the following message in the terminal, move on to the DISM scanning step:
    • Integrity violations found but some could not be repaired.

Executing the DSM Scan

  1. Open the Windows PowerShell terminal with admin rights.
  2. Copy and paste the following command inside the console:
dism /online /cleanup-image /restorehealth
  1. Hit Enter to execute the script.
  2. Allow DISM scan to fix the Windows file system with the latest reference image file from Microsoft.
dism scan

Perform a Clean Boot

  1. Type System in the Start menu and click on the System Configuration tool below the Best match section.
  2. Go to the Services tab and checkmark the box for the Hide all Microsoft Services option.
  3. Hit the Disable all button.
System config
  1. Click on the Startup tab and select Open Task Manager.
  2. The link will take you directly to the Startup tab of Task Manager.
  3. Disable all active startup processes except for drivers, like Bluetooth, Realtek HD Audio, etc.
Disable startup
  1. Go back to the Services tab of System Configuration.
  2. Hit the Apply button.
  3. Restart your PC.

Now, test if the issue goes away. Whatever the outcome is, don’t forget to reboot into normal mode by enabling all third-party services again.

Use Windows System Restore

Did the ERROR_LOCK_VIOLATION start appearing after a major change to the PC? You might try rolling back the changes by following these steps:

  1. Open the About window of Windows Settings by pressing the Windows and Pause Break keys together.
  2. Scroll down to the bottom of the About screen and click on System protection.
system protection
  1. The System Properties dialog box will open taking you directly into the System Protection tab.
  2. Click on the System Restore button.
system restore button
  1. The System Restore dialog box will open. Click Next.
  2. Select a restore point from the table and click Next.
system restore dialog
  1. Click Finish to start the System Restore process.
  2. Follow the onscreen instructions.

Contact Microsoft Consumer Support for a Hotfix

If you’re using any of the following Windows PC or Server systems and none of the above fixes are working, you should contact the technical support team:

  • Windows Server 2008
  • Windows Server 2008 R2
  • Windows Server 2008 Service Pack 2 (SP2)
  • Windows Server 2008 R2 Service Pack 1 (SP1)
  • Windows 7
  • Windows 7 Service Pack 1 (SP1)
  • Windows Vista Service Pack 2 (SP2).

Visit the Contact us page and select the Windows OS logo. On the Windows overlay box, hit the Get Business Support button if you’re coming from a business organization. Alternatively, if you’re an individual user, click on the Get Home Support option.

support

You’ll have to sign in with a Microsoft 365 or Microsoft Live account to contact a premium support specialist.

account

Summary

So, these are the methods you can follow to fix the Windows file system error ERROR_LOCK_VIOLATION in various OS editions.

Did these solutions work for you? Do you know a better fix? Comment below to share your thoughts. Additionally, learn how to deal with a similar problem, ASSIGN_DRIVE_LETTERS_FAILED.

More about the topics: Windows

User forum

0 messages