Buzz Shock

Smooth icon storytelling with classy flair.

updates

How to use the diskpart utility to assign and remove drive letters

Written by Andrew Mccoy — 0 Views

This post will demonstrate 2 tools for assigning a drive letter in Windows 10,8,7. You can change drive letter with Windows Diskpart or a users-friendly software – AOMEI Partition Assistant.

By Cherry / Last Updated June 25, 2021

Windows OS users know that they have two amazing tools for managing the disks and partitions–Disk Management and Diskpart. The Disk Management tool in Windows gives you an easy-to-use graphical interface that can manage disk only with mouse-clicking. While Diskpart is a tool that you can manage your disk or partition on the command prompt quickly. To assign letter to drive, you can use both Disk Management and Diskpart. If you want to change the drive letter quickly, the Diskpart utility makes it easy.

Assign drive letter with CMD

To assign, change, or remove a drive letter, you can use the Windows interface of Disk Management, or use the command line on the prompt of Diskpart. Diskpart is a built-in tool that you can use to manage your hard drive, like format disk partition, create partition, delete partition, etc. well, how to assign drive letter with Diskpart?

Step 1. To use a command line, you need to open the command line first. Click Start, type “cmd” at the search box, and right-click the program, select “Run as Administrator”, or press “WIN+R”, type “cmd” and press Enter. Then, type “diskpart” to start.

Step 2. Type list volume and press Enter. Here you should know the number of the simple volume whose drive letter you want to assign, change, or remove.

How to use the diskpart utility to assign and remove drive letters

Step 3. Select volume n and press Enter. Here you can select the volume whose drive letter you want to assign, change, or remove.

How to use the diskpart utility to assign and remove drive letters

Step 4. Then, if you want to assign or change the drive letter, type “assign letter=R”.

How to use the diskpart utility to assign and remove drive letters

If you want to remove the drive letter, type “remove letter=R”.

How to use the diskpart utility to assign and remove drive letters

Therefore, you have already assigned, changed, or removed a drive letter. And you can type list volume to see the details.

Actually, you may assign a drive letter when you create a new one. For that, you need to create partition first. After creating a partition, type “assign letter=?” to that partition. Or, if there is some volume hidden, it will not have the drive letter, to unhide it, you need to assign a drive letter for it. Thus, Diskpart may have a little bit complex. Fortunately, there is another easier and simpler way, which could save a lot of steps.

Easier to assign drive letter with AOMEI Partition Assistant

AOMEI Partition Assistant Standard is a great powerful partition manager whereВ you assign drive letter with an easy-to-use graphical interface. Since AOMEI Partition Assistant 5.8 Edition released, it added the partassist.exe utility, which you can use to manage disk and partition with command line. To assign drive letter with partassit.exe, here are the steps you can follow.

Step 1. Install AOMEI Partition Assistant to your computer. Open the command prompt by clicking Start, typing “cmd”, and right-clicking the program, then selecting “Run as Administrator”, or pressing “WIN+R”, typing “cmd” and press Enter. Then, type “cd C: \Program Files \AOMEI Partition Assistant Standard Edition 5.8”, press Enter. To assign a drive letter, you can use the parameters “ partassist.exe /hd:0 /setletter:0 /letter:F”. Here, we take an example for assigning a drive letter to a hidden volume.

Step 2. Type: partassist.exe /list. Press Enter. It will list all disks on your computer.

Step 3. Type: partassist.exe /list:1, then press Enter, it will show you all the volumes on disk 1.

Step 4. Type: partassist.exe /hd:1 /fmt:H /fs:fat32 /label:xbox

How to use the diskpart utility to assign and remove drive letters

Press Enter, and wait till the progress reaches 100%. Actually, you can also use this syntax to change drive letter for other volumes. But if you want to remove a drive letter, you can use the following parameters:

Remove a drive letter, type: partassist.exe /hd:0 /setletter:0 /letter:*

How to assign drive letter with GUI interface?

AOMEI Partition Assistant provides you another way to assign drive letter much easier. that is using GUI. people can assign drive letter or remove drive letter without Diskpart command nor Partition Assistant command line.

>Launch AOMEI Partition Assistant, it will show you all storage devices in the main interface. you can see the removable drive doesn’t have a drive letter. If you want to assign a drive letter for the drive, here you need to right click it, select Advanced-> Change Drive Letter.

How to use the diskpart utility to assign and remove drive letters

>Then, select a drive letter for the drive.

How to use the diskpart utility to assign and remove drive letters

>Click Apply to submit the task.

How to use the diskpart utility to assign and remove drive letters

AOMEI Partition Assistant supports almost all Windows operating systems, like Windows 10, 8, 7. It has many editions for different OSes. The AOMEI Partition Assistant Server edition is for Windows Server 2003/2008(R)/2012(R); the Standard and Professional edition is for Windows PC OS, like Windows XP/Vista/7/8/8.1/10. Both Diskpart and AOMEI Partition Assistant can manage disk with command line, but AOMEI is more flexible and easier, and simpler.

Note:В Although the system drive letter can be changed, do not do it because that would make the system unable to boot.

Diskpart is very powerful Windows Utility, which allows certain number of operation with hard disk.
In this article we will show you how to assign, change or remove drive letter with Diskpart using.

How to use the diskpart utility to assign and remove drive letters

You bought hard drive for Backup, but it has automaticaly gained letter D. You want to change it to E.
First we need to open Command Prompt with Administrator Rights.

Type cmd into the search box, and then right-click and choose Run as administrator. If you have Windows 10 use the CTRL + SHIFT + ENTER keyboard shortcut on Screen 1, or click on Start with right click and choose Command Prompt (Admin) on Screen 2.

When Command Prompt pops up, run the diskpart command.

How to use the diskpart utility to assign and remove drive letters

Now we type list volume to list our volumes, we need to know the number of our volume.

How to use the diskpart utility to assign and remove drive letters

In our case our hard drive is Volume 3 and that number is 3.

Now we use command select volume 3 to make changes to that volume. If your volume number is different, you need to replace number 3 with the number from your volume. After we have selected our volume we use command assign letter E, to assing letter E to our volume.

How to use the diskpart utility to assign and remove drive letters

Now you know how to change or assign another letter to your volume, also if you need you can remove volume letter with command remove letter E

How to use the diskpart utility to assign and remove drive letters

For security reasons you cannot change or remove your current system disk letter (esp C), it will not work.

To exit diskpart type in exit.

How to use the diskpart utility to assign and remove drive letters

Has this article been helpful for your request?
(2 votes, average: 5.00 out of 5)

Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work. Read more.

How to use the diskpart utility to assign and remove drive letters

The Disk Management tool in Windows gives you an easy-to-use graphical interface to dealing with partitions and drive letters, but what if you want to just quickly change a drive letter on the command prompt? The diskpart utility makes it easy.

You’ll need to start by opening an administrator mode command prompt — type cmd into the search box, and then right-click and choose Run as administrator, or use the CTRL + SHIFT + ENTER keyboard shortcut.

How to use the diskpart utility to assign and remove drive letters

Once there, run the diskpart command, and then type in the following to list out the volumes on your system.

You’ll want to note the volume number next to the drive that you want to change the letter of. In our case, that number is 3.

How to use the diskpart utility to assign and remove drive letters

Now we’ll use the select volume command to tell diskpart to make changes to that volume. If your drive number is different, you’ll want to replace the 3 with the number in your configuration.

You should see a message that the volume is now selected.

How to use the diskpart utility to assign and remove drive letters

At this point you can easily assign a new drive letter. Just type in this command, substituting R for the drive letter you’d like to use:

Make sure to hit enter once you’re done, of course.

How to use the diskpart utility to assign and remove drive letters

Once you’ve made that change, your drive should show up again as a new device, and be available for browsing immediately.

If you want to unassign a drive letter in order to hide the drive, you can also use the remove letter command in the same way. We wouldn’t necessarily advise doing this, of course.

How to use the diskpart utility to assign and remove drive letters

Don’t bother trying to change your C: drive, because that’s not going to work.

How to use the diskpart utility to assign and remove drive letters

Diskpart is one of the most powerful Windows command line utilities which first appeared in Windows XP. Diskpart is mainly used by Windows administrators to manage tasks like partition management, formatting, creating, re-sizing and getting a detailed information regarding the hard disk or other removable disks attached to the computer. Even though you have a built-in GUI application called Disk Management utility in Windows, Diskpart is much more flexible and works well in a server environment where you need to set up some advanced features like RAID.

Note: This post isn’t intended for beginners, and doing something wrong while using Diskpart utility may cause drive failures and data losses, so make sure that you have a good backup before continuing. You have been warned.

Assign Drive Letter Using Diskpart

Assigning a new drive letter to a partition or removable device using Diskpart is really easy. First, search for the command prompt in the Start menu, right click on it and select the option “Run as administrator.” If you are using Windows 8, press “Win + X” to open the power user menu and select the option “Command Prompt (Admin).”

How to use the diskpart utility to assign and remove drive letters

The above action will open the command prompt window with administrative rights. Here enter the following command to start the Diskpart utility.

How to use the diskpart utility to assign and remove drive letters

The next step is to list all the volumes in your computer so that you can clearly see all the volume numbers and drive letters of your hard disk partitions and any other removable devices. Use the command below to list all the volumes.

How to use the diskpart utility to assign and remove drive letters

Once the Diskpart utility lists all the volumes, take a note of the volume number of the drive you want to assign a new drive letter. In my case, I’m trying to assign a new drive letter to the drive I:\ , so my volume number is 7 . Now execute the following command to select the volume while replacing the # symbol with an actual volume number.

How to use the diskpart utility to assign and remove drive letters

Once the volume is selected, use the following command to assign a new drive letter. Don’t forget to replace the letter “V” with the drive letter you want to assign.

How to use the diskpart utility to assign and remove drive letters

That’s all there is to do; you have successfully changed or re-assigned a new drive letter to a partition or a removable drive in Windows. In fact, if you open the Windows explorer, you can see that the change is reflected immediately.

Remove Drive Letter using Diskpart

Before moving any further, removing or un-assigning drive letter will effectively hide the drive or partition from plain sight, i.e. you cannot see that drive in the Windows explorer. To remove a drive letter, follow the above steps 1 through 4 and then use the below command to remove the drive letter of a drive or partition. Don’t forget to replace the letter “I” with the actual drive letter.

How to use the diskpart utility to assign and remove drive letters

As soon as you have done that, Diskpart will remove the drive letter for that volume. If you list the volumes again, you will see that the drive you just interacted with will have no drive letter next to it.

How to use the diskpart utility to assign and remove drive letters

Moreover, if you navigate to the Windows explorer, you will see that the drive which got un-assigned isn’t listed anymore. But again, always be careful while you are messing around with Diskpart utility; it may cause irrecoverable data loss if used incorrectly.

Hopefully that helps, and do comment below if you face any problems while following the steps or to simply share your thoughts.

Vamsi is a tech and WordPress geek who enjoys writing how-to guides and messing with his computer and software in general. When not writing for MTE, he writes for he shares tips, tricks, and lifehacks on his own blog Stugon.

  • Facebook
  • Tweet

4 comments

Thank you fo the nice info , I have found a portable freeware make the same job easily plus have some extra features ; Drive Letter Changer

I assume that another drive letter can be assigned to a volume that had its letter removed.

Yes, you can assign any other drive letter which is not in use.

I AM CURIOUS IF YOU REMOVE THE DRIVE LETTER YOU PREVIOUSLY HARD ASSIGNED WILL IT JUST MAKE THE REGISTRY ON THAT COMPUTER FORGET THE DRIVE LETTER. THEN THEREFORE MAKING THE DRIVE TAKE THE NEXT AVAILABLE LETTER UPON PLUGGING IT BACK INTO THE SAME COMPUTER OR ON ANY OTHER COMPUTER.

Comments are closed.

Affiliate Disclosure: Make Tech Easier may earn commission on products purchased through our links, which supports the work we do for our readers.

The Disk Management tool in Windows gives you an easy-to-use graphical interface to dealing with partitions and drive letters, but what if you want to just quickly change a drive letter on the command prompt? The diskpart utility makes it easy.

You’ll need to start by opening an administrator mode command prompt — type cmd into the search box, and then right-click and choose Run as administrator, or use the CTRL + SHIFT + ENTER keyboard shortcut.

Once there, run the diskpart command, and then type in the following to list out the volumes on your system.

You’ll want to note the volume number next to the drive that you want to change the letter of. In our case, that number is 3.

Now we’ll use the select volume command to tell diskpart to make changes to that volume. If your drive number is different, you’ll want to replace the 3 with the number in your configuration.

select volume 3

You should see a message that the volume is now selected.

At this point you can easily assign a new drive letter. Just type in this command, substituting R for the drive letter you’d like to use:

Make sure to hit enter once you’re done, of course.

Once you’ve made that change, your drive should show up again as a new device, and be available for browsing immediately.

If you want to unassign a drive letter in order to hide the drive, you can also use the remove letter command in the same way. We wouldn’t necessarily advise doing this, of course.

Don’t bother trying to change your C: drive, because that’s not going to work.

A permanent drive letter prevents us from being confused with multiple USB drives. Then, how to permanently assign drive letter with ease?

By Lily / Last Updated January 7, 2021

Why to permanently assign drive letter?

As we know, Windows assigns drive letters to all the drives that are available on the computer, such as internal hard disks, optical drives, SD cards, and external USB drives. Drive letters are alphabetical identifiers for volumes and each drive letter can be used once on one computer.

However, some users discover USB drive letter keeps changing each time they connect it to the same computer. It happens frequently if they use multiple USB drives on one computer. That’s really frustrating! At this time, assigning permanent drive letters to USB drives is needed.

In addition, some users perform regular backup between the USB drive and the computer via a USB hidden copier. With a persistent drive letter, the backup task can be recognized and repeated by the backup utility smoothly. What we need to do is to permanently assign drive letter.

How to permanently assign drive letter with ease?

There are three efficient solutions I’d like to recommend to you. Learn how to assign a static drive letter in Windows 10 below:

Solution #1: assign a persistent drive letter with Disk Management

1. Hit Windows Key + X on your keyboard, and select Disk Management from the menu.

2. Right click the USB drive to which you want to assign a persistent drive letter and select “Change Drive Letter and Paths.”

How to use the diskpart utility to assign and remove drive letters

3. In the pop-up window, click “Change”.

How to use the diskpart utility to assign and remove drive letters

4. In the next window, choose a proper drive letter for your USB drive using the drop-down menu and click “OK”.

How to use the diskpart utility to assign and remove drive letters

вњђ Tips: You may choose a rarely-used drive letter like M-Z, thus avoiding possible drive letter conflicts.

5. You will get a prompt that some programs might rely on drive letters to run properly. Click “Yes” to continue as long as the drive letter you assign here is not occupied by another drive where the programs are installed.

How to use the diskpart utility to assign and remove drive letters

Solution #2: assign a static drive letter by Command Prompt

1. Tap the Search button on the taskbar and type “cmd” in the search box. Right-click “cmd” and select “Run as administrator”.

2. Type diskpart and press Enter.

3. Type list volume and press Enter.

4. Type select volume # (ex: volume 7) and press Enter to select the USB drive to be assigned a static drive letter. You may get indication from the size of the volume.

5. Type assign letter=# (ex: letter=M) and press Enter to assign a new drive letter.

6. Double type exit and press Enter to exit Diskpart and Command Prompt successively.

How to use the diskpart utility to assign and remove drive letters

Solution #3: assign drive letter permanently with the best freeware

AOMEI Partition Assistant Standard, the best partition manager, can help you assign a permanent drive letter to a USB drive. It can be operated with mouse-clicking and it’s totally free. Just follow the instructions below:

Step 1. Download, install and launch AOMEI Partition Assistant. Right click the USB drive which you want to give a permanent drive letter to, select “Advanced” and then “Change Drive Letter”.

How to use the diskpart utility to assign and remove drive letters

Step 2. Select a new drive letter in the pop-up window. You are suggested choosing a rarely-used drive letter like M-Z.

How to use the diskpart utility to assign and remove drive letters

Step 3. Click “Apply” to view pending operations and then “Proceed” to commit the operations.

How to use the diskpart utility to assign and remove drive letters

вњЌ Note: To change partition type ID for MBR disk partitions and change serial number on a certain partition, please upgrade to AOMEI Partition Assistant Professional.

Verdict

You have learned three exact ways to permanently assign drive letters for USB drives. After you commit one of the solutions, every time you connect the same drive to the same computer, Windows 10 will automatically recognize it and set the same letter. However, if you insert your external drive into another computer, it is likely to get a different drive letter. Apart from assigning a drive letter to a certain drive permanently, you can also repair pen drive not detected and fix the error that C drive is RAW with AOMEI Partition Assistant. Go for this tool and you won’t regret!

Diskpart is one of the most powerful Windows command line utilities which first appeared in Windows XP. Diskpart is mainly used by Windows administrators to manage tasks like partition management, formatting, creating, re-sizing and getting a detailed information regarding the hard disk or other removable disks attached to the computer.

Even though you have a built-in GUI application called Disk Management utility in Windows, Diskpart is much more flexible and works well in a server environment where you need to set up some advanced features like RAID.

Note: This post isn’t intended for beginners, and doing something wrong while using Diskpart utility may cause drive failures and data losses, so make sure that you have a good backup before continuing. You have been warned.

Assign Drive Letter Using Diskpart

Assigning a new drive letter to a partition or removable device using Diskpart is really easy. First, search for the command prompt in the Start menu, right click on it and select the option “Run as administrator.” If you are using Windows 8, press “Win + X” to open the power user menu and select the option “Command Prompt (Admin).”

How to use the diskpart utility to assign and remove drive letters (Courtesy of MakeTechEasier.com)

The above action will open the command prompt window with administrative rights. Here enter the following command to start the Diskpart utility.

(Courtesy of MakeTechEasier.com)

The next step is to list all the volumes in your computer so that you can clearly see all the volume numbers and drive letters of your hard disk partitions and any other removable devices. Use the command below to list all the volumes.

Once the Diskpart utility lists all the volumes, take a note of the volume number of the drive you want to assign a new drive letter. In my case, I’m trying to assign a new drive letter to the drive I:, so my volume number is 7. Now execute the following command to select the volume while replacing the # symbol with an actual volume number.

Once the volume is selected, use the following command to assign a new drive letter. Don’t forget to replace the letter “V” with the drive letter you want to assign.

That’s all there is to do; you have successfully changed or re-assigned a new drive letter to a partition or a removable drive in Windows. In fact, if you open the Windows explorer, you can see that the change is reflected immediately.

(Courtesy of MakeTechEasier.com)

Remove Drive Letter using Diskpart

Before moving any further, removing or un-assigning drive letter will effectively hide the drive or partition from plain sight, i.e. you cannot see that drive in the Windows explorer. To remove a drive letter, follow the above steps 1 through 4 and then use the below command to remove the drive letter of a drive or partition. Don’t forget to replace the letter “I” with the actual drive letter.

(Courtesy of MakeTechEasier.com)

As soon as you have done that, Diskpart will remove the drive letter for that volume. If you list the volumes again, you will see that the drive you just interacted with will have no drive letter next to it.

(Courtesy of MakeTechEasier.com)

Moreover, if you navigate to the Windows explorer, you will see that the drive which got un-assigned isn’t listed anymore. But again, always be careful while you are messing around with Diskpart utility; it may cause irrecoverable data loss if used incorrectly.

Content Type Maintenance & Performance

Article ID 000022179

Last Reviewed 11/25/2019

Critical Instructions:

DiskPart*

Microsoft DiskPart is a powerful tool that you can run on the CMD without using a GUI. The tool is more flexible than Disk Management.

To run DiskPart:

  1. Type DiskPart on the CMD or invoke the tool with the Run window. A User Account Control message pops up.
  2. Provide admin rights to the tool and accept the message to run the tool.

How to use the diskpart utility to assign and remove drive letters

DiskPart has many options and commands. See the basic steps below to initialize and erase a drive.

First, select the drive you’re working on:

  • List disk: Displays the list of attached disks and USB flash drives
  • Sel disk (select disk): Selects the scope to work in
  • Clean all: Removes partition and volume information from the selected device

Next, with your device clean (in factory state), create partitions and format it. Select your drive and type the following commands to create partitions:

  • List part: Display partitions available on the drive (a fabric state would not have partitions)
  • Sel part: Used to select a partition to work on
  • Del part: Used to delete the selected partition

If you don’t have partitions, you can create a new one.

Create part primary: This command creates a primary partition of the full size of the drive. You can also specify an extended or logical partition or the size desired for the partition using size=”xxx”.

Now select your partition to format and configure it with the selected partition type:

  • Format override fs=”NTFS” label=”label”: Performs a low-level format (secure erase), configures your partition on NTFS file system, and sets the desired label.

You can also use other parameters and functions of this command. For example, to run a quick format in place of override, type format quick fs=”NTFS” label=”test” size=409600 (size is in MB).

You have created and formatted your partition. If the partition doesn’t have a letter assigned, you can’t see the drive on Windows*.

To see the drive, type the following commands:

  • List vol: List all volumes available
  • Sel vol: Select the volume that you already create with the last commands.
  • Assign letter: Assign a letter to the drive so Windows sees your drive. The drive is ready to use. For example: assign letter=D.

For more information about DiskPart, see the commands syntax and commands explanation.

Windows 10 assigns an available drive letter to a new drive connected to the computer. The operating system goes through the alphabet from A to Z to find the first available letter to assign it to various drives. It is possible to remove a drive letter assigned by the OS.

Historically, Windows reserves the drive letters A and B for floppy drives. Modern Windows versions assign the letter C to the system partition on which Windows is installed. Even in a dual-boot configuration, Windows 10 displays its own system partition as C:.

Removing a drive letter can be very useful for a number of situations. For example, you can quickly hide the drive from all apps. While Windows offers a Group Policy tweak to hide a drive, it will affect the File Explorer app only. Alternative file manager apps like FAR, Total Commander, etc will show the drive regardless of the options mentioned in the article:

However, if you remove a drive letter, the drive will become hidden from all apps installed on your computer. You can use this trick to quickly hide the presence of a drive or to prevent other apps from writing to a drive or partition and modifying the data stored there.

In Windows 10, there are a number of methods you can use to remove drive letters. This can be done with Disk Management, diskpart, and PowerShell. Let’s review these methods.

To remove a drive letter in Windows 10, do the following.

  1. Press the Win + X keys together.
  2. In the menu, select Disk Management.
  3. In Disk Management, right-click on the partition whose drive letter you would like to change. Select Change Drive Letter and Paths in the context menu.
  4. In the next dialog, click on the Remove. button.
  5. Confirm the operation.

You are done. The drive will disappear in File Explorer. The removed letter can now be assigned to another drive.

Change the drive letter in the command prompt

  1. Open an elevated command prompt.
  2. Type diskpart .
  3. Type list volume to see all drives and their partitions.
  4. Look at the ### column in the output. You need to use its value with the command select volume NUMBER . Substitute the NUMBER portion with the actual partition number for which you want to change the drive letter.
  5. Type the command remove letter=X to remove the drive letter. Substitute the X portion with the appropriate letter.

You are done. You can close the Diskpart window.

Change the drive letter in PowerShell

  1. Open an elevated PowerShell instance.
  2. Type Get-Disk to see the list of your drives.
  3. Type Get-Partition to see the list of your partitions.
  4. Note the disk number and the drive letter you want to remove and type the next command:

Ensure that the disk under the disk number contains the partition for which you want to remove the letter. In my case, I type Get-Disk 1|Get-Partition

  • Finally, type the following command:
  • This will remove the specified drive letter for the partition. In my case, the command looks as follows: Remove-PartitionAccessPath -DiskNumber 1 -PartitionNumber 1 -Accesspath F: . That’s it!

    Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

    Share this post

    About Sergey Tkachenko

    Sergey Tkachenko is a software developer from Russia who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

    3 thoughts on “ How to Remove a Drive Letter in Windows 10 ”

    This topic seems to now be out-of-date. In step 3 in Disk Management, the only option available in the context menu is ‘Help’. There is no “Change Drive Letter …” option anymore.

    It depends on your hardware and especially on the drive type you have installed.
    Also, your user account might be missing administrative account privileges.

    It works… kind of…

    Yes, it removes the drive letter, until I reboot. Then the drive letter is back again.