ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE [BSoD Fix]

Restart the SMB service

Reading time icon 5 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

A message from our partner

To fix various driver issues on your PC, you will need a dedicated tool to find the freshest and the original drivers. You can use PC HelpSoft Driver Updater to do it in 3 easy steps:

  • Download PC HelpSoft Driver Updater and install it on your PC
  • Start the scanning process to search for outdated or missing drivers that cause problems
  • Right-click on Update Now to allow the update process.
Download now PC HelpSoft has been downloaded by 0 readers this month

The ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE with error code 800 (0x320) and description The oplock that was associated with this handle is now associated with a different handle, appears when a file or shared folder on the network is in use, and the OpLock (Opportunistic Lock) linked to the file is moved to a different handle.

Opportunistic Lock speeds up file access when working with files on a network. You might see this error when more than one person or program attempts to access the same file simultaneously, and the system moves the OpLock from one user or program to another.

How can I fix ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE?

1. Check the share permissions

  1. Right-click the shared file or folder you want to check and select Properties.
  2. Go to the Sharing tab and select Advanced Sharing.
  3. Click Permissions.
  4. The Permissions window displays a list of users and groups that have access to the shared folder.
  5. You should have Full Control over the folder or file you want to access. You can also add a user or group to change the permissions.

Next, follow these steps to check NTFS permissions:

  1. On the Properties window of the file, go to the Security tab.
  2. You will get the list of users and groups with permissions to access the file or folder.
  3. Here, check and ensure your User group has Read or Full Control permission to access the file. Click Edit and adjust the permissions if needed.

Now that you have checked or adjusted all the permissions to get necessary access try accessing the file or folder. Furthermore, if multiple connections are accessing the same file at the same time, close the unnecessary programs.

2. Restart SMB client and server

  1. Press the Windows key, type cmd in the search box, and select Run as administrator from the list of options to launch Command Prompt with administrator rights.
  2. Copy & paste the following commands one by one to restart the SMB client or server service on the machine and hit Enter after every command:
    • For client-sidenet stop lanmanworkstation
      net start lanmanworkstation
    • For server-sidenet stop lanmanserver
      net start lanmanserver
  3. Close the Command Prompt window.

3. Disable Opportunistic Locking

  1. Press Windows + R to open the Run window.Regedit RUN COMMAND ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  2. Type regedit and click OK to launch the Registry Editor app.
  3. First, take a backup of registry entries, then go to File>Export and save the .reg file at an accessible location.fILE - EXPORT
  4. Navigate to this path: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
  5. Look for DWORD OplocksDisabled, double-click it and set the Value data to 1, then click OK.
  6. However, if you don’t see OplocksDisabled, right-click the right pane and select New, then DWORD(32-bit) Value from the sub-context menu.New - DWORD- ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  7. Now name the DWORD as OplocksDisabled, then double-click it.
  8. Set the Value data to 1, then click OK to save the changes.Value data
  9. Restart your computer to let the changes take effect.

4. Update the network driver

  1. Press Windows + R to open the Run window.Device Manager Run command - ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  2. Type devmgmt.msc and click OK to open Device Manager.
  3. From the list of system components, look for Network adapters, and click it to expand.
  4. Right-click the driver and select Update driver from the context menu.Update driver
  5. Click Search automatically for drivers.Search automatically ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  6. If Windows finds a driver suitable for you, follow the on-screen instructions to complete the process.

However, if Windows fails to find the best driver version, you can head to the device manufacturer’s website and manually install the driver. Alternatively, you can opt for a reliable third-party driver updater tool to ensure all the device’s drivers are up to date.

If updating the network driver didn’t help fix the ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE, follow these steps to reinstall the driver:

  1. Relaunch the Device Manager, click to expand the Network adapters category, right-click, and select Uninstall device.Uninstall ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  2. Click Uninstall.
  3. Go to Action, then choose Scan for hardware changes from the drop-down menu.Scan for hardware changes

5. Disable antivirus temporarily

  1. Press the Windows key, type security in the search box, select Windows Security, and choose Open.Windows Security open Windows key ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  2. Go to Virus & threat protection, and click Manage settings.Manage Setting V&T settings
  3. Look for Real-time protection and toggle off the switch.Real time protection off EERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE

If after turning off real-time protection, the ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE appears, follow the steps to add the network share or file server as exclusion:

  1. In Windows Security, Go to Virus & threat protection, and click Manage settings.
  2. Scroll down to find Exclusions, and click Add or remove exclusions.Add exclusions ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  3. Click Yes on the UAC prompt.
  4. Click the Add an exclusion button, then select File or Folder.Exclusion list select folder
  5. Select the file from the window, then click Select Folder.

If you have third-party antivirus software, you can turn it off for a shorter period and check if the BSoD error still occurs.

6. Run the CHKDSK scan

  1. Press the Windows key, type cmd in the search box, and select Run as administrator from the list of options to launch Command Prompt with administrator rights.CMD elevated ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE
  2. To check the integrity of your file system and fix logical disk errors, copy & paste the following command and hit Enter: chkdsk C: /f /rCHKDSK FRC
  3. If the drive is in use, you will be prompted to schedule the scan after a restart. Type Y and press Enter.
  4. Restart your computer to initiate the scan and fix any corruption on the disk.

In conclusion, to fix the ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE, you can restart the SMB service, disable opportunistic locking, run the CHKDSK utility, disable the antivirus, or update/reinstall network drivers.

Recently, we also covered some other BSoD errors, such as ERROR_OPLOCK_HANDLE_CLOSED ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY and ERROR_CORRUPT_LOG_OVERFULL

If you have any questions or suggestions about the BSoD error, feel free to mention them in the comments section below. We will be happy to help you!

More about the topics: BSOD, BSoD error codes, Windows 11

User forum

0 messages