Solved Diskpart Has Encountered an Error Access Is Denied

Fixed Diskpart Has Encountered an Error Access Is Denied

Trying to manage your disks with diskpart? But wait! Have you ever confronted an error saying diskpart has encountered an error: access is denied? If so, and if you want solution for it, then this article is your guide to resolve diskpart has encountered an error: access is denied with some quick fix solutions.

Wondershare Recoverit Authors

Aug 18, 2020 • Filed to: Answer Hard Drive Problems • Proven solutions

0

Hello everyone! :)

I've been trying to format a 32GB flash drive. I'm using DiskPart to format it, but still have no success. I've been trying and trying, but I always encounter the same error. "DiskPart has encountered an error: Access is denied. See the System Event Log for more information". I tried different commands to format it, but I still arrive at the same error. I am the admin, so I don't think that's the problem.

LIST DISK
SELECT DISK 1
CLEAN ALL
CONVERT MBR
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS QUICK

(I did try FAT and FAT32, none of those worked)

Help me please!

Thank you and have a nice day! :)

If you are attempting to clean your disks i.e. USB flash drive or any SD card via diskpart, you are going to confront the error saying diskpart has encountered an error: access is denied. It fails to access the drive. This means either there is any connection issue due to which the drive is not accessed or there exist any blockage of drive that is hindering the process of format via diskpart. Hence leading to show up the error i.e. diskpart has encountered an error: access is denied. This article will explain all about the error, its reason and potential solutions to resolve it.

Diskpart being a utility to manage your disks/drive either external or internal, comes in a user friendly GUI along with all its disk management tools. If the in-built GUI disk management on windows 10 fails to work properly, diskpart is there to work. But this does not mean that it is immune against error. While using diskpart you may confront a potential error i.e. diskpart has encountered an error: access is denied. This will not allow you to access the targeted disk/drive and would block all the functionality of utility. The error code applied to this is 5@020A0019. In the system event log, you may see something like Failed to open device \\?\GLOBALROOT\Device\HarddiskVolume5. It represents the drive as unauthorized or write-protected. This article will explain about the potential reasons causing the error, some quick fix methods to resolve the error and method to recover the data from inaccessible hard drive. Here are the topics that would be discussed in detail.

Part 1: Why This Error Occurs?

Before digging in deep to find out the quick fix techniques to resolve the error i.e. diskpart has encountered an error: access is denied, at first, let’s find out the potential underlying causing working in background to show up this error while using diskpart. Here are some of them:

1. Command Prompt doesn’t have administrative privileges:

While using diskpart to format the disk/drive, you can use the CMD command prompt. In case, if your command prompt does not have the administrative privileges, you are not able to write any command to run for proceeding with action. In order to get rid of this, try to operate the command prompt with admin access.

2. Write protection is enabled for the drive:

Sometimes, the disk/drive is write protected and accessing it without any authority to make changes on it may end up showing the error i.e. diskpart has encountered an error: access is denied. If you want to make changes on the drive/disk with diskpart, first disable the security feature from diskpart or else you can use registry editor to disable the write protection.

These two culprits may disturb the normal functioning of diskpart and fails the utility to perform any action on the targeted disk/drive.


Part 2: How to Fix Diskpart Has Encountered an Error Access Is Denied Issue?

Once you are familiar with the actual reason behind diskpart has encountered an error: access is denied, now next step is to find out some quick fix techniques to resolve the error. Here in this section, you may find some built-in utility methods to fix diskpart has encountered an error: access is denied. Let’s get started!

Method 1. Running the Command Prompt with Administrative Privileges

As mentioned above, due to the command prompt without administrative privileges, you may confront the error. Easiest way to fix the error is to run the command prompt with admin access. Here are the steps to follow:

Step 1: Press windows key + R to launch the run dialogue box. As the box launch, type cmd in it and press ctrl + Shift + Enter to launch the elevated command prompt.

Step 2: In the next window of UAC (user account control), click yes to give the administrative access/privilege.

Step 3: Now in the elevated command prompt, open diskpart utility.

If administrative access was the issue causing error, it would be resolved and you can easily run the commands.

Method 2. Removing the Write Protection from the Drive

In the above section of reason causing diskpart has encountered an error: access is denied, the second culprit was the write protections. So in order to resolve the error, disabling write protection may help. Here are the steps:

Step 1: In the main menu of windows, click on start and in drop down select the option of run.

Step 2: In the search box, type regedit.

Step 3: Nextly, navigate across HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.

Step 4: In the next window, double click write protect and change the numeral to 0.

Disabling the write-protection can be done via diskpart or registry editor. Here is how u=you can use both built-in utilities.

Disabling write protection via Diskpart

Using disport to remove the write-protections of targeted disk/drive to resolve error i.e. diskpart has encountered an error: access is denied, here are the steps:

Step 1: Press windows key + R to launch the run dialogue box. In the box type diskpart and click enter to continue. Open diskpart.

Step 2: In the next command prompt, type the following commands and click enter.

list disk
1. Select Disk X
attribute disk clear readonly

Step 3: Once all the commands are typed, now restart your device to check if the error is resolved. Use diskpart to check the operation.

Disabling write protection via Registry Editor

If you are opting the registry editor to disable the write protection of disk/drive then here are the steps to follow:

Step 1: Press windows key + R to launch the run command box. In the box type regedit and click enter to launch registry editor.

Step 2: Allow the administrative privileges via UAC (user account control). Locate for the path in registry editor i.e. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.

Step 3: Make the value to 0.


Part 3: How to Recover Data from Hard Drive?

In case, if you are unable to resolve the error diskpart has encountered an error: access is denied, then surely there ae some other technical or physical issue with drive. The best possible way is to recover all the data saved on the drive to avoid data loss. Or in case you have lost your data from the targeted drive, you can easily recover it via third party recovery software. In this context, Recoverit data recovery is the best tool to be considered as your solution. The tool helps to recover the data from all corrupted/damaged partitions and bad sectors of the drive. You can recover everything i.e. images, videos, document files, audio files etc. it is compatible with both the internal and external hard drive. Wondering how it works? Here are the steps:

Step 1: Attach the targeted drive (corrupted drive) with your device, in case if you lot data from external hard dtive. Make sure it is in appropriate connection.

Step 2: Download and install Recoverit data recovery software on your device.

Step 3: Once installed, launch the software and in the main menu, select the data recovery mode. If you have lost the data from internal drive, then you can select the deleted files recovery and if you have lost data from external drive, you can go for external devices recovery.

recoverit-interface

Step 4: In the next window, select the drive from where you lost the data and cluck start to initiate the scan.

operations-during-scanning

Step 5: The software will scan all the lost files and retrieve them. In case, if it is not working, you can select the all-around recovery mode.

preview-recovered-photos

Step 6: All the retrieved files will be displayed on the screen. Preview them one by one and select the files you want to restore. Click recover to complete the action.

Once the files are recovered, make sure you save them on different location apart from the one from where you lost the files at first. Hence, diskpart is a useful utility that manage your disks/drive on computer. It is compatible with both the internal and external drives/disks. When windows 10 built-in disk management fails to work properly, diskpart can work efficiently on its behalf. But it also face a potential error i.e. diskpart has encountered an error: access is denied. It occur due to write-protection issues or command prompt problems that are running without administrative access. Both of the reasons make drive inaccessible for diskpart and presents it as blocked or unauthorized. This article explains quick fix methods to resolve the error. You can fix the issue by running command prompt with administrative privileges or disable the write-protection either by diskpart or registry editor. If you still fail to resolve the error, the use Recoverit data recovery software to restore all the lost data from corrupted/damaged drive.

Recoverit author

Theo Lucia

chief Editor

0 Comment(s)
Home > Resources > Answer Hard Drive Problems > Fixed Diskpart Has Encountered an Error Access Is Denied