To Remove Drive Letter in Command Prompt using Diskpart


By default, Windows 10 will automatically assign an available drive letter to any connected internal and external storage devices.


Windows progresses through the alphabet from A to Z to assign available drive letters to devices as connected.

  • Windows reserves the drive letters A and B for floppy drives, but you can still manually assign them to a drive.
  • The drive letter C can only be used for the drive Windows is installed on. If you multi boot operating systems, the currently running Windows will always show its drive letter as C.


If you remove the drive letter from a volume, partition, or disk, it will no longer be available to show as a drive in File Explorer "This PC".

This tutorial will show you different ways to remove a drive letter in Windows 10.

 CONTENTS:

  • Option One: To Remove Drive Letter in Disk Management
  • Option Two: To Remove Drive Letter in Command Prompt using Diskpart
  • Option Three: To Remove Drive Letter in Command Prompt using Mountvol
  • Option Four: To Remove Drive Letter in PowerShell
  • Option Five: Remove Drive Letters of Previously Connected Drives and Disks using DiskPart automount Command
  • Option Six: Remove Drive Letters of Previously Connected Drives and Disks using mountvol Command
OPTION ONE
To Remove Drive Letter in Disk Management
1. Press the Win+R keys to open Run, type diskmgmt.msc into Run, and click/tap on OK to open Disk Management.
2. Right click or press and hold on the drive (ex: "G") you want to remove the drive letter of, and click/tap on Change Drive Letter and Paths. (see screenshot below)
3. Click/tap on the Remove button. (see screenshot below)
4. Click/tap on Yes to confirm. (see screenshot below)
5. When finished, you can close Disk Management if you like.
 
OPTION TWO

To Remove Drive Letter in Command Prompt using Diskpart
1. Open an elevated command prompt.

2. Enter diskpart into the elevated command prompt, and press Enter. (see screenshot below)
3. Enter list volume into the elevated command prompt, and press Enter.
4. Make note of the volume number (ex: 5) for the drive letter (ex: "G") you want to remove.
5. Enter the command below into the elevated command prompt, and press Enter.

 select volume volume number

 Substitute volume number in the command above with the actual volume number (ex: "5") from step 4 above for the drive letter (ex: "G") you want to remove.

For example: select volume 5

6. Enter the command below into the elevated command prompt, and press Enter.
 remove letter=drive letter

 Substitute drive letter in the command above with the actual drive letter (ex: "G") you want to remove.
For example: remove letter=G

If the new drive letter you assign is not available, you will get an error message indicating so in the command prompt. You will just need to repeat this step to assign an available drive letter.

7. When finished, you can close the elevated command prompt if you like.

 
OPTION THREE
To Remove Drive Letter in Command Prompt using Mountvol
1. Open an elevated command prompt.
2. Type the command below into the elevated command prompt, and press Enter. (see screenshot below)
 mountvol Drive Letter: /d
 Substitute Drive Letter in the command above with the actual drive letter (ex: "G") you want to remove.
For example: mountvol G: /d
3. When finished, you can close the elevated command prompt if you like.
 
OPTION FOUR
To Remove Drive Letter in PowerShell
1. Open an elevated PowerShell.
2. Enter Get-Partition into the elevated PowerShell, and press Enter. (see screenshot below)
3. Make note of the disk number (ex: "1") and PartitionNumber (ex: "3") for the DriveLetter (ex: "G") you want to remove.

 The disks will be listed in numerical order starting with "0" at the top.

4. Enter the command below into the elevated PowerShell, and press Enter to verify the disk number (ex: "1") is correct for the drive letter (ex: "G") you want to remove.
 Get-Disk disk number | Get-Partition

 Substitute disk number in the command above with the actual disk number (ex: "1") from step 3 above for the drive letter (ex: "G") you want to remove.
For example: Get-Disk 1 | Get-Partition

5. Enter the command below into the elevated PowerShell, and press Enter to verify the disk number (ex: "1") is correct for the drive letter (ex: "G") you want to remove.

 Remove-PartitionAccessPath -DiskNumber disk number -PartitionNumber partition number -Accesspath drive letter:

 Substitute disk number in the command above with the actual disk number (ex: "1") from step 3 and verified in step 4 above for the drive letter (ex: "G") you want to remove.

Substitute partition number in the command above with the actual PartitionNumber (ex: "3") from step 3 for the drive letter (ex: "G") you want to remove.

Substitute drive letter in the command above with the actual DriveLetter (ex: "G") from step 3 above you want to remove.

For example: Remove-PartitionAccessPath -DiskNumber 1 -PartitionNumber 3 -Accesspath G:

6. When finished, you can close the elevated PowerShell if you like.
 
OPTION FIVE
Remove Drive Letters of Previously Connected Drives and Disks using DiskPart automount Command
1. Open an elevated command prompt.
2. Type diskpart into the elevated command prompt, and press Enter. (see screenshot below)
3. Type automount scrub into the elevated command prompt, and press Enter.
4. Close the elevated command prompt.
5. Restart the computer to apply.
 
 
OPTION SIX
Remove Drive Letters of Previously Connected Drives and Disks using mountvol Command
1. Open an elevated command prompt.
2. Type mountvol /r into the elevated command prompt, and press Enter. (see screenshot below)
3. Close the elevated command prompt.
4. Restart the computer to apply.