Diskpart Has Encountered an Error Access Is Denied | How to Fix  

Diskpart Has Encountered an Error Access Is Denied | How to Fix


Overview of Diskpart Access Denied Issue

Some users have reported that when they try to clear a USB flash drive with the command prompt and diskpart, they failed midway clean the disk due to the error message:

Diskpart has encountered an error: Access is denied.

See the System Event Log for more information.

When checking the System Event Log, you might see the error message: Failed to open device \\?\GLOBALROOT\Device\HarddiskVolume5. Error code: 5@020A0019. It means that the storage device is considered to be blocked (or write-protected), and has to be authorized.

3 Ways to Fix DiskPart Access Denied

To help you get rid of the error message, we have listed 3 solutions below. You can use both the built-in tool and third-party tool to solve this problem. Choose the most appropriate one according to your needs, and try it as instructions.

1. Run the Command Prompt as Admin

This method is suitable for storage devices that require authorization. First, you need to start a command prompt as an administrator:

Step 1. Click Start, click All Programs, and then click Accessories.

Step 2. Right-click Command prompt, and then click Run as administrator.

Step 3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

Run diskpart again. See if the access is denied error disappears.

2. Remove Write Protection on the Hard Disk, USB Flash Drive or Memory Card

As mentioned above, if your storage device is write-protected, you can also see the "Diskpart has encountered an error: Access is denied" error. Here are the detailed steps of how to fix the disk is write-protected.

1. Open up your start menu and click "Run"

2. Type regedit in the box.

3. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies

4. Now double click the "WriteProtect" key and change the value to 0.

3. Download Third-Party Format Software to Get Rid of Diskpart Access Denied Problem

Why were you insisting on formatting a disk storage drive or removable storage media in the command prompt with diskpart utility? It's tricky, and not a perfect solution for ordinary Windows users. Reasons are apparent to see. As soon as diskpart encountered errors, besides access is denied, many other similar errors only make users go nut. For example, diskpart has encountered an error, the parameter is incorrect, incorrect function, etc.

Therefore, finding a diskpart alternative should be the best way to tackle the problem that prevents you from formatting a disk, performing a clean, or creating a partition. Qiling Partition Master free is such an ideal alternative tool that provides all diskpart features for home & office users. Here are some features of this tool:

Download Qiling free partition manager and follow the instruction to format partitions on your Windows computer.

Step 1: Launch Qiling Partition Master. On the Disk management window, select the partition that you want to format and click "Format".

Step 2: Set a new partition label, file system (NTFS/FAT32), and cluster size to the selected partition, and click "Proceed" to continue.

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!