Ever tried using DiskPart and got smacked with the error message: “DiskPart has encountered an error: Access is denied”? Ouch! It feels a bit like getting locked out of your own virtual garage. But don’t worry—you don’t need to be a tech wizard to fix it.
This error usually means your computer won’t let DiskPart touch the disk you’re targeting. Let’s break that down in a fun, snack-sized way.
Why It Happens
All Heading
There’s always a reason behind the madness. Here are the main culprits:
- Not running as administrator
- Write protection is on
- Your drive is controlled by another program or service
- Permissions issue with the drive
Now, let’s put on our DIY hats and fix this thing!
Step 1: Run DiskPart as Administrator
This is the number one cause of the error. If DiskPart isn’t launched with admin powers, it can’t make any meaningful changes. Here’s how to flex those admin muscles:
- Type cmd into your Start menu.
- Right-click Command Prompt and choose Run as administrator.
- In the command window, type diskpart and hit Enter.
Boom! Now you’re the boss.

Step 2: Remove Write Protection
Write protection is like a digital safety lock. Even DiskPart can’t break it—unless we tell it to!
- Once in DiskPart, type:
list disk
- Identify your target disk (look at the size if you’re unsure).
- Type:
select disk X
(replace X with your disk number). - Then type:
attributes disk clear readonly
This should kick write protection to the curb.
Step 3: Close Programs Using the Drive
If any app is still poking around the disk—like antivirus software or file explorers—it can block DiskPart. Here’s what to do:
- Close all programs, especially ones that might use the drive.
- Unplug and replug USB drives if needed.
- Try again with just Command Prompt open.
Still no luck? Don’t sweat it. We’ve got more tricks!
Step 4: Change Drive Permissions
If it’s a permissions issue, Windows might be blocking access like a stubborn bouncer at a club.
- Open File Explorer and right-click on the drive.
- Go to Properties > Security tab.
- Click Edit then give your user account Full control.
- Click Apply and OK.
Now try running DiskPart again. With new permissions, it should listen to you like an obedient robot.

Step 5: Use Disk Management (Plan B)
Still struggling? Let’s sidestep DiskPart and use its friendly cousin, Disk Management:
- Press Windows + X and choose Disk Management.
- Find the drive, right-click and choose what you need (format, delete, etc.).
Same result, less drama.
Need a Reset? Try This
If your USB or external drive is being difficult:
- Back up any data (if you can).
- Open DiskPart and select the disk.
- Type the following carefully:
clean create partition primary format fs=ntfs quick assign
This gives the drive a clean slate. Like a fresh haircut for your USB stick.
Important Notes
- If you’re on a work or school computer, IT might have locked things down.
- Some drives are hardware locked. If that’s the case, DiskPart can’t help—it’s not magic.
Wrap-Up
Getting hit with the “Access is denied” error in DiskPart can feel like shouting into the void. But with a few simple steps, you can take back control and get your disk drama sorted out.
Always remember: run as admin, clear write protection, close apps, and check permissions. If all else fails, Disk Management is waiting with open arms.
Happy formatting—and may your drives always obey your commands!
Recent Comments