Script Drive Letter Assignments

When you connect a new drive (a USB flash drive, optical drive, SD card or another type of storage devices) to your computer, Windows 10 automatically assigns a drive letter to identify the device and make it accessible. However, if you use multiple drives, you'll probably notice a new letter whenever you reconnect the same drive, which can be frustrating.

Fortunately, you can manually assign a permanent letter to any drive you connect using Windows 10 (excluding the C drive, of course). That's not only to stop the OS from assigning different letters. Windows 10 could also try to set a letter that's already in use, and you'll need to resolve the conflict. Or perhaps you simply want to assign drive letters in a way that makes more sense to you.

Whatever the reason, Windows 10 offers a few ways to manually assign permanent drive letters, as long as you connect the drive to the same computer and the letter is available.

In this Windows 10 guide, we'll walk you through the steps to permanently assign drive letters to peripherals, such as USB storage devices, disk drives, using Disk Management and the Command Prompt.

How to assign a drive letter using Disk Management

On Windows 10, you can manage drive letters without third-party tools using Disk Management.

To assign a new drive letter, do the following:

  1. Use the Windows key + X keyboard shortcut to open the Power User menu.
  2. Select Disk Management.
  3. Right-click the drive on the list and select Change Drive Letter and Paths.

  4. Click the Change button.

  5. Use the drop-down menu and select the drive letter you want to use.

Once you complete these steps, every time you connect the same drive to the same computer, Windows 10 will automatically set the same letter. However, if you take your external drive to another computer, it'll likely get a different drive letter.

In the rare case, you run out of letters and you need to access a different drive, you can use the steps mentioned above, but on step No. 4, click the Remove button and then connect the new drive.

How to assign a drive letter using Command Prompt

Although Disk Management provides a user-friendly interface to manage drive letters, you can also assign drive letters using the DiskPart command-line tool in Command Prompt.

To assign a drive letter using Command Prompt, do the following:

  1. Open Start.
  2. Search for Command Prompt, right-click the result, and select Run as Administrator.
  3. Type the following command to start DiskPart and press Enter:

  4. Type the following command to list all the volumes on your computer and press Enter:

  5. Type the following command to select the volume to change the letter and press Enter:

    • In the command, remember to change 3 for the number of the volume you want to change.
  6. Type the following command to assign a new drive letter. In this case, you'll assign the letter Z. Then press Enter:

    • In the command remember to change 3 for the number of the volume you want to change.

After you had complete the steps, every time you connect the drive to the same computer, it should receive the same drive letter you assigned using DiskPart. However, if you take the drive to another device, the OS will likely assign it a different letter.

If you must remove the drive letter, you can follow the same steps, but on step No. 6, you'll need to run the remove letter=Z command.

Wrapping things up

While you can manually assign a permanent letter to drives you connect to your computer, the move won't stop Windows 10 from randomly assigning the same letter to another drive when the first drive is not plugged in.

However, you can reduce the chances of getting the same letter, or running into conflicts, by using letters in backwards order. For example, instead of using D, E or F, it might be better to use Z, Y or X when assigning a new letter to a drive.

This guide is focused on Windows 10, but the same steps will work for Windows 8.1, Windows 7 and previous versions.

More Windows 10 resources

For more help articles, coverage, and answers to common questions about Windows 10, visit the following resources:

The drive letter you want is already used by another partition? Your drive doesn’t appear in File Explorer and no drive letter is assigned? In this tutorial we’ll show you 2 ways to manually change drive letter of any volume on your hard disk or USB storage device. Quickly get the missing or desired drive letter back in Windows 10.

Method 1: Change Drive Letter in Windows 10 Using Disk Management

  1. To get started, you need to open Disk Management. In Windows 10, you can access it by pressing Windows key + X and then selecting Disk Management.
  2. In the right pane you can see the details of all volumes and partitions on your hard drive and removable media. Right-click on the volume or partition you want to change, and select Change Drive Letter and Paths.

  3. In the next dialog box, click Change.

  4. Choose the the Assign the following drive letter option, then click the drop-down list to select your desired drive letter and click OK.

  5. A warning message box will pop up. Click Yes and your drive should now have the new letter assigned.

Method 2: Change Drive Letter in Windows 10 Using Command Prompt

  1. Open the Command Prompt in Administrator mode. This can be done by press the Windows key + X and then selecting “Command Prompt (Admin)“.

  2. At the command prompt, type diskpart and press Enter. Next type list volume to list out all volumes on your computer. Note down the volume number next to the drive that you want to change the letter of. In our case, that number is 4.

  3. Type the following command to select the volume whose drive letter you want to change. Replace 4 with the volume number you noted down in above step.
  4. Run the following command to assign a new drive letter. Substitute A for the new drive letter you’d like to use.

    Tips: if you want to remove the drive letter only, type “remove letter=F“. Replace F with the current drive letter.

  5. Now you’ve successfully changed the drive letter in Windows 10. Your drive should show up with a new drive letter.

One thought on “Script Drive Letter Assignments

Leave a Reply

Your email address will not be published. Required fields are marked *