5 Ways to Fix ERROR_DIRECT_ACCESS_HANDLE

Check if you are using the right handle

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

The ERROR_DIRECT_ACCESS_HANDLE with the error message 130 (0x82) Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O usually occurs there is an attempt to use a file handle associated with an open disk partition for an operation that isn’t allowed.

First, check whether you are using the right handle for the operation. For example, if you are performing a file operation, ensure you are using a file handle; similarly, use a raw disk handle for disk operations.

How can I fix the ERROR_DIRECT_ACCESS_HANDLE?

1. Check the disk access mode

When accessing a disk partition for raw I/O in Windows, it is important to use the correct access modes and flags. You can use GENERIC_READ and GENERIC_WRITE to enable reading and writing. However, to ensure direct communication with the hardware, you must include FILE_FLAG_NO_BUFFERING to disable system caching and FILE_FLAG_RANDOM_ACCESS to optimize non-sequential operations.

2. Run the app with admin rights

  1. Locate the app from the desktop or start menu, right-click it, and choose Run as administrator from the context menu.
  2. Click Yes on the UAC prompt to allow the app to run with elevated rights.

3. Update the disk driver

  1. Press Windows + R to open the Run window.Device Manager Run command ERROR_DIRECT_ACCESS_HANDLE
  2. Type devmgmt.msc and click OK to open the Device Manager app.
  3. Go to Disk Drives, and click it to expand.
  4. Right-click the drive and select Update driver from the context menu. ย Update driver - ERROR_DIRECT_ACCESS_HANDLEย 
  5. Click Search automatically for drivers.Search automatically
  6. Follow the on-screen prompt to complete the process.

If this doesn’t help or there is no update for the driver, try reinstalling it. For that, follow these steps:

  1. Open Device Manager, go to Disk Drives, and expand it.
  2. Right-click the drive and select Uninstall device from the context menu.Uninstall device
  3. Click Uninstall on the following window.
  4. Once the process is complete, go to Action and select Scan for hardware changes.Action scan for hardware changes
  5. Windows will scan and reinstall the driver; restart your computer to save the changes.

4. Run the CHKDSK scan

  1. Press the Windows key, type cmd in the search box, and click Run as administrator.CMD elevated - ERROR_DIRECT_ACCESS_HANDLE
  2. Type the following command to repair the disk after replacing C with the system drive letter you want to check and hit Enter. The F parameter in the command will fix all the errors it finds: chkdsk C: /f 
  3. If the drive is in use, you will see a message indicating that it can’t lock the drive; therefore, it will ask you to check it the next time when the system restarts. Type Y and press Enter.CHKDSK
  4. If prompted, restart your computer to allow chkdsk to run and fix errors on the drive.

5. Uninstall the third-party disk management tool (if any)

  1. Press Windows + I to open the Settings app.
  2. Go to Apps, then click Installed apps.Apps - Installed apps
  3. Locate the third-party disk management app, click the three dots icon, and select Uninstall.Uninstall - the ERROR_DIRECT_ACCESS_HANDLE
  4. Click Uninstall and follow the on-screen instructions to complete, then check if the issue persists.
  5. If it does, then you can reinstall the software from its official website.

To conclude, you must use the proper file handle for an operation, run the app with admin rights, and ensure your device drivers are updated. You can also run the SFC and CHKDSK scan to ensure nothing wrong with the disk and system files.

To avoid issues like ERROR_DIRECT_ACCESS_HANDLE, you can use built-in Windows tools like Disk Management and Command Prompt. Disk Management can help you perform tasks like formatting and partitioning without issues, and Command Prompt lets you take care of low-level disk operations.

Also, it would help if you temporarily disabled your security software, as it could sometimes interfere with disk operations.

In case you have other disk-related errors, like repairing disk errors, this might take an hour; the first step is to wait for the process to complete, and you still see errors, read this guide to learn the solutions.

If you have any other questions or suggestions about ERROR_DIRECT_ACCESS_HANDLE, feel free to mention them in the comments section below. We’re happy to help!

More about the topics: Windows 11

User forum

0 messages