Featured Articles
- 01 Use Diskpart to Create Volume (Boot, System, RAID, etc.)
- 02 Use DiskPart to Delete All Partitions in Windows
- 03 Use Diskpart to Convert GPT Disk to MBR
- 04 Use Diskpart to Merge Partitions
- 05 Best Diskpart Alternatives for Windows 11/10/8/7
- 06 Use Diskpart to Fix Device Read Only Issue
- 07 Troubleshooting 1: Fix DiskPart I/O Device Error in Windows 10/8/7
- 08 Troubleshooting 2: Fix Diskpart Has Encountered an Error Access Is Denied
- 09 Troubleshooting 3: Fix Diskpart Failed to Clear Disk Attributes
- 10 Troubleshooting 4: 8 Fixes to Remove System Cannot Find the File Specified Error
- 11 Troubleshooting 5: How to Fix DiskPart Virtual Disk Service Errors
- 12 Diskpart Delete Partition Override Not Working
- 13 Diskpart Clean Not Working on Disk/USB/SD Card
Overview of Diskpart Has Encountered an Error Access Is Denied
Some users have reported that when they try to clear a USB flash drive with the command prompt and diskpart, they fail 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.
Diskpart Has Encountered an Error Access Is Denied - 3 Fixes
We have listed three solutions below to help you get rid of the error message. You can use the built-in and third-party tools 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 the 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. If access is denied, the error disappears.
There are two ways to help remove this error: share these ways with others in need.
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.
Registry Alternative - Write-Protection Removal Tool
If you don't consider yourself a pro-computer user and you're not familiar with command-lines, don't worry. There are graphical-based solutions to help you remove write-protection from your hard drives, USB drives, and even SD cards.
EaseUS CleanGenius is one of these tools that helps you fix aforementioned issues on your drives without knowing a thing about command-line.
Here's an easy-to-follow guide on how to use this tool to get your issues sorted:
Step 1: DOWNLOAD and install EaseUS CleanGenius (free) on your computer.
Step 2: Run EaseUS CleanGenius on your PC, select Optimization and choose the Write Protection mode.
Step 3: Select the device that is write-protected and click Disable to remove the protection.
Have nowhere to find the specified regedit path? Move on to the final resort.
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 the 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 being denied, many other similar errors only made users go nuts. 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. EaseUS 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:
- Format disk partitions in simple clicks.
- Fix C Drive Access Denied on Windows 10
- Enable users to organize hard drives well to enhance system performance.
- Migrate OS to SSD to speed up Windows.
- Change disk style from MBR to GPT/primary to logical without data loss, and vice versa.
Download EaseUS free partition manager and follow the instructions to format partitions on your Windows computer.
It applies to Windows 10, 8.1, 8, 7, XP, and Vista.
Step 1. Launch EaseUS Partition Master, right-click the partition on your external hard drive/USB/SD card which you want to format and choose the "Format" option.
Step 2. Assign a new partition label, file system (NTFS/FAT32/EXT2/EXT3/EXT4/exFAT), and cluster size to the selected partition, then click "OK".
Step 3. In the Warning window, click "Yes" to continue.
Step 4. Click the "Execute 1 Task(s)" button in the top-left corner to review the changes, then click "Apply" to start formatting your external hard drive/USB/SD card.
Conclusion
Diskpart is a useful utility that can manage disks on your computer. But it also faces a potential error, i.e., diskpart has encountered an error: Access is denied. It occurs due to write-protection issues or Command Prompt problems running without administrative access. Both reasons make the drive inaccessible for diskpart and present as blocked or unauthorized.
This article introduces quick fixes to resolve the Diskpart Access Denied Error. You can resolve this issue by running Command Prompt with administrative rights or disabling write protection via diskpart or Registry Editor.
Was This Page Helpful?
Roxanne is one of the main contributors to EaseUS and has created over 200 posts that help users solve multiple issues and failures on digital devices like PCs, Mobile phones, tablets, and Macs. She loves to share ideas with people of the same interests.
Jean is recognized as one of the most professional writers in EaseUS. She has kept improving her writing skills over the past 10 years and helped millions of her readers solve their tech problems on PC, Mac, and iOS devices.
Related Articles
-
How to Format SD Card for Dash Cam on Windows/Mac/Dash Cam
Cici/Oct 29, 2024
-
How to Create More Than 4 Partitions on MBR Disk - Two Efficient Ways
Sherly/Sep 23, 2024
-
Fix 'The Specified Disk Is Not Convertible' Error in Windows
Brithny/Apr 22, 2024
-
Clone Seagate HDD to SSD with Seagate Disk Clone Software
Tracy King/Nov 27, 2024