how do i change a drive letter in command prompt

Top Contributors in Windows 11: Ramesh Srinivasan  -  neilpzz  -  Kapil Arya MVP  -  _AW_  -  Horace Wiggins   ✅

February 14, 2024

Top Contributors in Windows 11:

Ramesh Srinivasan  -  neilpzz  -  Kapil Arya MVP  -  _AW_  -  Horace Wiggins   ✅

  • Search the community and support articles
  • Search Community member

Ask a new question

LightJack05

  • Article Author

Manually assigning a drive letter using CMD/Diskpart

[Localization from this article: Manuelles Zuweisen eines Laufwerksbuchstaben mit CMD bzw. Diskpart - Microsoft Community ]

Technical Difficulty: Expert

Applies to: Windows 10 & 11

In some cases, Windows will not assign a drive letter automatically to an inserted drive. For example, this can happen when using a Windows installation media.

In that case, you can use diskpart to manually assign a drive letter.

NOTE: If your drive doesn't get assigned a drive letter, even though you are in a normal Windows environment, this can indicate a problem with the drive. Please back up your files in that case.

Open up a command prompt (CMD/PowerShell).

Type "diskpart" to start up diskpart. You will see the prompt change to "DISKPART>".

how do i change a drive letter in command prompt

Type "list vol" to list all available volumes. You can identify the drive by size and file system.

Additionally, the volume doesn't currently have a drive letter.

how do i change a drive letter in command prompt

Select the volume using "sel vol <number>".

how do i change a drive letter in command prompt

Assign the drive letter using "assign letter=<letter>".

how do i change a drive letter in command prompt

You can now exit diskpart by typing "exit" and switch to the drive using "<letter>:".

how do i change a drive letter in command prompt

It should also be available from Windows Explorer now.

50 people found this helpful

  • Subscribe to RSS feed

Was this article helpful? Yes No

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this article?

Thanks for your feedback, it helps us improve the site.

Thanks for your feedback.

Comments (17) 

* Please try a lower page number.

* Please enter only numbers.

Joe13 B-) 2.0

Thanks for the tutorial, I don't think I need to use Google for it anymore!

Congrats on Article Author too! :)

Report abuse

6 people found this comment helpful

Was this comment helpful? Yes No

How satisfied are you with this comment?

Thanks for the tutorial, I don't think I need to use Google for it anymore! Congrats on Article Author too! :)

5 people found this comment helpful

Thanks! Happy I could help! :)

1 person found this comment helpful

RAJU.MSC.MATHEMATICS

Very helpful Thanks.

3 people found this comment helpful

Thank for this informative article.

I ran this in PowerShell PS C:\WINDOWS\system32> GWMI -namespace root\cimv2 -class win32_volume | FL -property DriveLetter, DeviceID

The results are below. I need to know more about the DriveLetter, that does not have a letter and I cannot give it a letter, as you can see in DiskPart.

I'm sure someone personally hacking my computer. I'm wondering if this them hiding on it, and that is why I someone is typing over me and has more control at times of my computer then I do. Maybe a hidden AD Hoc.

I have searched for this on Google I'm either getting blocked or there is no information out there on this.

PS C:\WINDOWS\system32> GWMI -namespace root\cimv2 -class win32_volume | FL -property DriveLetter, DeviceID

DriveLetter : B:

DeviceID : \\?\Volume{26xxxxxx--xxxx-xxxx-xxxxxxxxxxxxxx}\

DriveLetter : C:

DriveLetter :

DeviceID : \\?\Volume{d5xxxxxx--xxxx-xxxx-xxxxxxxxxxxxxx}\

DriveLetter : D:

PS C:\WINDOWS\system32> DiskPart

Microsoft DiskPart version 10.0.19041.1

Copyright (C) Microsoft Corporation.

On computer: My Computer

DISKPART> List Volume

Volume ### Ltr Label Fs Type Size Status Info

---------- --- --- -------- ----- ---------- ------- --------- --------

Volume 0 D RAW DVD-ROM 2048 B Healthy

Volume 1 B System Rese NTFS Partition 100 MB Healthy System

Volume 2 C NTFS Partition 698 GB Healthy Boot

2 people found this comment helpful

I followed the instructions to CHANGE the letters assigned for three external hard drives. (The computer had named them E, F, G but gave the names to the wrong external hard drive) I changed the letters to the correct names singly (I disconnected the two not being adjusted) Now, I have 2 E, 2 F, 2 G names in the list (when accessed through File Explorer. When I click on "This PC", it shows just the one of each. If I click on either, or both of the same letter name, the same exact files will open. This is annoying. Anyone have a clue what can be done? This is on a brand new computer running Windows 11.

Sorry about the late reply.

That sounds weird... Usually, windows doesn't allow you to assign a drive letter twice.

If you want to change the letters, you usually have to remove them first and then reassign them.

Can you send me a screenshot of disk management, and of the list of volumes?

the partition that is not shown in diskpart is most likely some sort of recovery or reserved partition.

This is not the typical way of hiding an infection with malware...

Also, do note that your ESP (Volume B) should not be mounted, since modifying it can corrupt your Bootloader.

As for the suspected hacking, what symptoms did you observe? Mouse moving on its own, high resource usage, unexpected firewall prompts? Other things?

If you have a compromised system, its almost impossible to clean it from infections without doing a clean install of windows. I would suggest you do that if you suspect an infection. It will take time though and will delete everything on your PC. (Including files, programs, settings.) Create a backup before you reinstall.

There are no viruses nor malware on this computer. I believe it is a reflection of the original name choice. The information contained on each external hard drive is identical, yet when I go into MY PC, it only shows one set of externals. I am afraid to delete one of the duplicates because it might be just mirrored and it will make everything go away. I have way too many things on these external hard drives to lose any of them.

Thanks for your input. Jan

Forum Article Info

  • Devices and drivers
  • Norsk Bokmål
  • Ελληνικά
  • Русский
  • עברית
  • العربية
  • ไทย
  • 한국어
  • 中文(简体)
  • 中文(繁體)
  • 日本語

MiniTool

How to Change Drive Letter with CMD Windows 10

Diskpart is a command-line tool in Windows system that allows you to manage your disks and partitions. This post introduces how to change drive letter with CMD in Windows 10, namely, by using Diskpart CMD tool. MiniTool software provides users a free disk partition manager, data recovery software, system backup and restore software, etc.

If you want, you can change drive letter for a drive with CMD (Command Prompt) in Windows 10. This post includes detailed guides for how to use Diskpart command-line tool to change driver letter in CMD.

How to Change Drive Letter with CMD in Windows 10

Diskpart is a Windows built-in CMD tool that lets you easily manage hard drive and change drive letter. To change or assign drive letter in CMD, you can firstly open Diskpart utility in Command Prompt. Check the steps below.

Step 1. Open CMD in Windows 10

You can press Windows + R , type cmd , and press Ctrl + Shift + Enter to open elevated Command Prompt .

Step 2. Open Diskpart tool

In Command Prompt window, you can type diskpart command, and press Enter . This will open the Diskpart command-line utility.

Step 3. Change drive letter CMD

Next you can type the command line below to change drive letter in Command Prompt in Windows 10. Remember to press Enter after typing each command line.

  • list volume (this command will list all available volumes detected by your computer)
  • select volume * (replace “*” with the exact volume number of the target partition)
  • assign letter=* (replace “*” with the preferred drive letter like “F”)

Windows change drive letter

After you change or assign a drive letter for a drive or device, Windows will display the same letter automatically next time you reconnect the device to your computer.

If you want to remove the drive letter of a specific drive, you can type remove letter=* command and press Enter . Still, replace “*” with the exact drive letter of the target drive.

How to Change Drive Letter Using PowerShell

Some Windows 10 users might find that Command Prompt is missing from Win + X menu , and instead, it shows Windows PowerShell. Windows PowerShell can do most things that Command Prompt does. Alternatively, you can also use Windows PowerShell to change drive letter in Windows 10.

Step 1. Press Windows + X , and choose Windows PowerShell (Admin) to run Windows PowerShell utility as administrator.

Step 2. Next type get-disk command and press Enter to list all available drives the computer detected.

Step 3. Then you can type the command: Get-Partition -DiskNumber 1 | Set-Partition -NewDriveLetter F , and press Enter to assign a new drive letter. You should change “*” with the actual disk number of target drive, and replace “F” with the new drive letter you’d like to assign to the drive.

change drive letter PowerShell

MiniTool Partition Wizard – Professional Free Disk Partition Manager

Instead of using CMD or PowerShell to change drive letter for a drive in Windows 10, you can also utilize third-party free disk partition manager like MiniTool Partition Wizard to easily change drive letter and manage disk partitions on Windows 10.

MiniTool Partition Wizard let you easily create/delete/extend/resize/format/wipe partitions, convert partitions formats, migrate OS, clone disk, test hard drive speed , analyze hard drive space usage, check and fix disk errors , and more.

change drive letter with MiniTool Partition Wizard

By following the detailed guides above, you can easily change drive letter with CMD (Command Prompt), PowerShell or MiniTool Partitioon Wizard on Windows 10.

About The Author

Position: Columnist

Sign up for our daily newsletter

  • Privacy Policy
  • Advertise with Us

How to Remove and Assign Drive Letters in Windows with Diskpart

Vamsi Krishna

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).”

diskpart-launch-cmd-as-admin

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

diskpart-cmd-diskpart

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.

diskpart-list-volume

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.

diskpart-select-volume

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.

diskpart-assign-letter

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.

diskpart-drive-letter-changed

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.

diskpart-remove-letter

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.

diskpart-letter-removed

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.

Our latest tutorials delivered straight to your inbox

Vamsi Krishna

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.

Ms Paint Not Working Windows Featured Image

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Change a drive letter

  • 4 contributors
Applies To: Windows 11, Windows 10, Windows Server 2022, Windows Server 2019, and Windows Server 2016

If you want to change a drive letter assigned to a drive, or you have a drive that doesn't yet have a drive letter, use Disk Management to change it. You can also mount the drive in an empty folder so that it appears as a folder. For more information, see Mount a drive in a folder .

If you change the drive letter of a drive that already contains Windows or apps, apps might have trouble running or finding the drive. We suggest not changing the drive letter of a drive that already contains Windows or apps.

The following steps show how to change the drive letter.

Open Disk Management with administrator permissions.

In Disk Management, select and hold (or right-click) the volume on which you want to change or add a drive letter and select Change Drive Letter and Paths .

Screenshot showing the Disk Management window with the Change Drive Letter and Paths feature selected.

If you don't see the Change Drive Letter and Paths option or it's grayed out, the volume either isn't ready to receive a drive letter or it's unallocated and needs to be initialized . It might also be that the drive isn't accessible, which is the case with EFI system partitions and recovery partitions. If you've confirmed that your volume is formatted with a drive letter that you can access but you're still unable to change it, that's beyond the scope of this article. We suggest contacting Microsoft Support or the manufacturer of your PC for more help.

To change the drive letter, select Change . To add a drive letter if the drive doesn't already have one, select Add .

Screenshot of the Change Drive Letter and Paths dialog.

Select the new drive letter and choose OK . Then select Yes when prompted about how programs that rely on the drive letter might not run correctly.

Screenshot of the Change Drive Letter or Path dialog that shows how to assign a new drive letter.

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback .

Submit and view feedback for

Additional resources

How to assign permanent letters to drives on Windows 10

You can assign drive letters manually, and in this guide, we show you how on Windows 10.

how do i change a drive letter in command prompt

On Windows 10, when connecting a removable storage device or an internal hard drive, the system detects and assigns a drive letter automatically to make it usable. However, when reconnecting an external drive (such as a USB flash drive or SD or microSD cards), the system can end up assigning a different letter, which can be annoying.

If you want to see the same drive letter on a particular device, you can manually assign a permanent letter to any drive connected to your computer, and on Windows 10 , you can do this in at least three different ways, using Disk Management, Command Prompt, or PowerShell.

Using this approach will prevent Windows 10 from assigning a new letter or trying to set a letter already in use, which can cause conflicts. Also, it helps to select a drive letter that makes more sense to you.

In this Windows 10 guide, we walk you through several methods to manually assign a permanent letter to a drive, as long as you're connecting the drive to the same device and the letter isn't already in use.

How to assign a drive letter using Disk Management

How to assign a drive letter using command prompt, how to assign a drive letter using powershell.

To manage drive letters with the Disk Management tool, use these steps:

  • Open Start .
  • Search for Create and format hard disk partitions and click the top result to open the Disk Management experience.
  • Right-click the drive and select the Change Drive Letter and Paths option.
  • Click the Change button.
  • Select the Assign the following drive letter option.
  • Use the drop-down menu to assign a new drive letter. Quick tip: To avoid the system trying to assign the same letter to another drive, it's a good idea to start adding letters in backward order. For instance, instead of using D, E or F, it better to start with Z, Y or X when assigning a new letter.
  • Click the OK button.
  • Click the OK button again.

Once you complete these steps, the drive will permanently retain the assigned letter, even after reconnecting it. However, if you connect the drive to another device, it may receive a different letter.

While the easiest way to assign a new drive letter is to use Disk Management, you can also use DiskPart in Command Prompt to perform the same task.

To assign a drive letter using Command Prompt, use these steps:

  • Search for Command Prompt , right-click the result, and then select the Run as administrator option.
  • Type the following command to start DiskPart and press Enter : diskpart
  • Type the following command to list all the available volumes and press Enter : list volume
  • Type the following command to select the volume (drive) to assign a new letter and press Enter: select volume 3 In the command, make sure to change "3" to the number that represents the drive on your device.
  • Type the following command to assign a new drive letter, and press Enter : assign letter=Z The command assigns the letter "Z" to the drive assuming it's available. However, you need to make sure to change the letter for the one that you want to use.

After completing these steps, similar to Disk Management, every time you reconnect the storage to the same device, Windows 10 should assign the same letter automatically.

Alternatively, you can also use PowerShell to change a drive letter on Windows 10 using these steps:

  • Search for PowerShell , right-click the result, and then select the Run as administrator option.
  • Type the following command to list the available drives and press Enter : Get-Disk
  • Type the following command to assign a permanent letter to the drive and press Enter : Get-Partition -DiskNumber 1 | Set-Partition -NewDriveLetter Z In the command, make sure to change "1" to the number that represents the drive that you want to modify, and change "Z" for the new letter that you want to use.

Once you complete the steps, the drive will be accessible through File Explorer using the letter that you assigned, and Windows 10 won't try to change it.

Updated March 7, 2019: We revised this guide to make sure it's current with the latest version of Windows 10.

More Windows 10 resources

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

  • Windows 10 on Windows Central – All you need to know
  • Windows 10 help, tips, and tricks
  • Windows 10 forums on Windows Central

Get the Windows Central Newsletter

All the latest news, reviews, and guides for Windows and Xbox diehards.

Mauro Huculak

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.

  • 2 7 Nightingale tips and tricks for beginners I wish I knew before playing the game
  • 3 Microsoft brings Wi-Fi 7 support to Windows 11 with latest preview build, coming to everyone later this year
  • 4 New Helldivers 2 patch takes care of all those AFK queue dodgers, but one of its worst bugs still remains
  • 5 This PC comes without memory, storage, or an operating system, and it's the best thing to happen to laptops this year

how do i change a drive letter in command prompt

WindowsLoop

How to Change Drive Letter in Windows 10 & 11

Drive or partition letters are not fixed. You can change them. Here is how to change a drive letter in Windows 10 & 11 operating systems.

Windows automatically assigns a unique drive letter for all the drives, partitions, and plugged-in USB drives. Generally, the assigned letters are in incremental order starting with the letter C. For the most part, you don’t have to change the drive letter as it is pretty inconsequential in most cases. However, there might be times when you need to manually modify the drive letter of a drive, partition, or plugged-in USB drive to meet certain requirements.

For example, I want to use the drive letter X for one of my partitions because one of my older scripts requires it. The script won’t work as intended if it doesn’t have that specific drive letter. Since these are older files, and there are many of them, in typical Windows fashion, I tend to swap the drive letter rather than making the necessary changes to the script files.

Thankfully, Windows has several ways to change the drive letter . You can use the built-in partition manager or execute a few commands in the terminal. I will show both ways, follow the method you like.

Table of contents:

Change drive letter using partition manager

Commands to change drive letter.

Note: Close all active programs except your browser before proceeding with the below steps. It will reduce potential conflicts between programs and the drives.

Important: Do not change the drive letter of system volume or boot partition (C drive).

The steps below work the same in Windows 10 and 11.

Though most don’t know, Windows has a built-in partition manager called Disk Management. You can use it to quickly and easily change the drive letter. All you have to do is go to the drive options and choose the new drive letter.

Here is how to do it:

  • Press “ Win + R ” to open Run .
  • Type “ diskmgmt.msc ” and click “ Ok .”
  • Find the drive you want to modify.
  • Right-click on the drive.
  • Choose the “ Change drive letter and paths ” option.
  • Click the “ Change ” button.
  • Select the “ Assign the following drive letter ” radio option.
  • Choose a drive letter from the dropdown.
  • Click “ Ok .”
  • Click “ Yes ” in the warning window.
  • Again, click “ Yes ” in the second warning window.
  • Close the main disk management window.
  • You have successfully changed the drive letter in Windows 10 and 11.

Steps with more details:

First, search and open “Create and format hard disk partitions” from the Start menu. You can also use the “diskmgmt.msc” Run (Win + R) command.

After opening the Disk Management tool, find the drive you want to change the drive letter, right-click on it, and choose the “Change drive letter and paths” option.

Change-drive-letter-option-190820

Now, click the “Change” button.

Click-change-button-190820

Select the “Assign the following drive letter” radio option, choose a drive letter from the dropdown menu, and press “Ok.”

Select-new-drive-letter-190820

You will see a couple of warning prompts. Press the “Yes” button in both prompts.

Accept-changes-190820

Finally, close the Disk Management tool, and you are done.

That is all. You’ve successfully changed the drive letter in Windows. To make the changes take full effect, reboot the system.

Drive-letter-changed-190820

You can use the diskpart command to change the drive letter of any drive, partition, or USB drive in Windows. Here’s how to use the command to modify the drive letter.

Press the Windows Key to open the Start menu . Type “ Command Prompt ,” right-click on the result, and select the “ Run as administrator ” option. You can also right-click the Start menu, choose “Windows Terminal (Admin),” and open the Command Prompt tab in it.

After opening the cmd window, type “ diskpart ” and press Enter. This will launch the diskpart program in the cmd window.

Diskpart-command-190820

Type “ list volume ” and press Enter.

The above command will list all partitions and their volume numbers. Take note of the volume number of the drive you want to modify.

Next, execute the “ select volume #number ” command. Don’t forget to replace the #number with the actual volume number.

Diskpart-list-volume-select-volume-190820

After selecting the volume, execute the “ assign letter=NewDriveLetter ” command. Replace “ NewDriveLetter ” with the actual drive letter you want to assign.

Diskpart-change-drive-letter-190820

Once assigned, close the cmd window.

That is all. Once the diskpart commands are executed successfully, the drive letter is changed instantly. To make the changes take full effect, reboot Windows.

I hope this simple and easy Windows how-to guide helped you.

If you are stuck or need some help, send an email, and I will try to help as much as possible.

Did you know you can change a drive icon to anything you want? Follow the linked article to understand how to do it.

Leave a Comment Cancel Reply

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

Save my name, email, and website in this browser for the next time I comment.

Itechtics

5 Ways To Change Drive Letter In Windows 11, 10

Change Drive Letter

Windows is programmed to assign drive letters automatically when a new partition is created. If you do not like the drive letter assigned to a partition, or for any other reason, you can change it.

Windows assigns drive letters in alphabetical order, starting with “C.” “A” and “B” are reserved for floppy disk drives. Since the first partition to be created is the system drive, it is usually labeled “C” by default.

For a partition to show up in Windows Explorer , it must have a drive letter assigned to it. Otherwise, you cannot access the partition. This is also true in case you attach a USB flash drive to your computer.

Table of Contents

On This Page

Is it possible to change system drive letter.

Before we discuss how to change a drive letter, we must inform you that you cannot change the drive letter of the system drive, after the operating system has been installed on it. This is because many dependent applications and programs are installed which require the complete path to files to function properly.

If the drive letter in the path to a file is changed, the associated app may no longer function. For example, if the initial path “C:\Windows\System32” was changed to “J:\Windows\System32,” certain components of the app may no longer find the file required.

Similarly, if an app or program is installed on another partition other than the system partition, and it does not automatically pick up the changed path (which most modern apps usually do), you may have to make manual changes to the Windows Registries to provide the new path.

Let us now show you 5 ways to change drive letters in Windows.

How to Change Drive Letters in Windows

Change drive letter using disk management console.

The Disk Management Console provides several options to manage your storage partitions and volumes, such as formatting or creating new partitions, shrinking or expanding them, or assigning/changing drive letters.

Follow the steps given below to change the partition’s assigned drive letter:

Open the Disk Management Console by typing in “ diskmgmt.msc ” in the Run Command box .

Open the Disk Management Console

Right-click on the partition you want to change the letter for, and then click “ Change Drive Letter and Paths ” from the context menu.

Note: If you see that the option is not available or has been greyed out, then the partition’s drive letter cannot be changed.

Change the drive letter or path from the Disk Management Console

From the pop-up wizard, click  Change .

change 1

Select an available drive letter from the drop-down menu in front of “ Assign the following drive letter: ” and then click  Ok .

Assign a new drive letter from Disk Management Console

Click Yes on the confirmation dialog box .

Confirm drive letter assignment

[Conditional] You may then see another warning message. If you do, click  Yes  again, and then  restart  your computer for the changes to fully take effect.

Intimation for drive letter in use

You will now see that the drive letter has been successfully changed.

Change Drive Letter using Command Prompt

If you are a command-line guy, you can also change the drive letter of a partition using the Command Prompt. Here is how:

Open Command Prompt with administrative privileges .

Enter the disk partition mode by typing in the following, and then hitting Enter :

Enter the Disk Partition mode in Command Prompt

Run the following to obtain a list of current partitions and their details.

List all volume details in Command Prompt

Now select the volume for which you wish to change the drive letter by running the following cmdlet.

Replace [Number] in the command below with the volume number you see in the table obtained in Step 3 above.

Select a volume

Now use the following command to assign a new, vacant drive letter to this volume.

Replace [Alphabet]] with the new drive letter that you want to assign.

Assign a new letter to partition using Command Prompt

The new drive letter will now be assigned. You may now close the Command Prompt since the partition will now automatically open in Windows Explorer.

Change Drive Letter using PowerShell

Changing the drive letter using Windows PowerShell allows you to do so using the Command Line Interface (CLI) in a few easy cmdlets, as opposed to the lengthy process of using the Command Prompt. Here is how:

Launch Windows PowerShell with administrative rights .

Run the following cmdlet to get the current partitions and their associated details:

Get volume details in PowerShell

Now use this information to change a partition’s drive letter.

Replace [OldLetter] with the current drive letter for volume, and [NewLetter] with the new drive letter which you want to assign to the volume.

Assign a new drive letter using PowerShell

The drive letter will now change, and the partition will now automatically open in Windows Explorer.

Change Drive Letter from Windows Registry

You can also change the drive letter directly from the Windows Registry. Here is how:

Note: Misconfiguration of critical values in the system’s registry could be fatal for your operating system. Therefore, we insist that you create a system restore point or a complete system image backup before proceeding forward with the process.

You can also use our top selection of disk imaging and backup software so you never lose your data or operating system again.

Open the Registry Editor by typing in “ regedit ” in the Run Command box.

Open the Registry Editor

Now paste the following into the navigation bar at the top of the Editor for quick navigation:

Navigate to the MoutedDevices key

In the right-hand pane, look for the values whose name starts with “ \DosDevices .” This will display the current drive letters for the partitions on your computer.

Right-click on the drive letter you want to change, and then click Rename from the context menu.

For example, to change “J”, right-click “ \DosDevices\J: ” and then click Rename .

Rename Windows Registry to change the driver letter

Now rename the value and replace the old drive letter with the new one, as we did in the image below.

Change drive letter from Windows Registry

Now restart your computer for the changes to take effect.

When the computer reboots, you will see the drive letter has been changed.

Use Drive Letter Changer

Drive Letter Changer is a third-party freeware that can be used to perform a number of different tasks, including changing a partition’s drive letter. Moreover, it is portable software, which means it does not need to be installed on your PC.

Perform the following steps to download and use Drive Letter Changer to change drive letters:

Download the Drive Letter Changer here .

Extract the contents of the compressed folder.

Run the application labeled “ dChanger .”

The application will now automatically detect existing partitions and drive letters.

Right-click on the drive letter you want to change, expand “ Change drive letter ,” and then select a vacant drive letter that you wish to assign.

Change drive letter using third-party software

The drive letter will now change in an instant.

How to Swap Drive Letters Between Volumes

Unfortunately, there is no direct way of swapping drive letters between 2 partitions; you can only assign a vacant drive letter or remove it.

Therefore, if you wish to swap drive letters between two partitions, you must first change the drive letter of the primary partition to something else, so its initial drive letter becomes vacant. Then, change the drive letter of the secondary partition and assign the drive letter recently vacated from the primary partition. Now you can assign the vacated drive letter from the secondary partition to the primary partition.

This can be a bit confusing, so we have drafted down the process in the methods below.

Swap Drive Letter from Disk Management Console

Open the Disk Management Console by typing in “ diskmgmt.msc ” in the Run Command box.

diskmgmt

Right-click on the primary partition and click “ Change Drive Letter and paths “  from the context menu.

Change drive letter from the Disk Management Console

From the popup wizard, click  Remove .

Remove a drive letter

If prompted for a confirmation, click  Yes .

Confirm drive letter removal

You may then see another warning message. If you do, click  Yes  again.

Intimation of drive being in use

Now right-click on the secondary partition and click “ Change Drive Letter and paths ” from the context menu.

Change the drive letter of the secondary drive

Now assign the drive letter from the primary partition and click  Ok .

Assign the primary drive's letter to the secondary drive

In the confirmation box, click  Yes .

Now right-click on the primary partition again, and click “ Change Drive Letter and Paths ” from the context menu.

Change the drive letter of the primary drive again

From the pop-up wizard, click  Add .

Add a new drive letter

Now assign the drive letter initially assigned to the secondary partition, and click  Ok .

Assign a new drive letter to the primary drive

(Optional, but recommended) Now restart your computer so the changes can be finalized.

You can apply the same logic to switch drive letters between 3 or more partitions as well.

Swap Drive Letter using Command Prompt

You can also switch the drive letters between 2 partitions (or more) using the same logic. Here is how:

Enter the disk partition mode by typing in the following, and then hitting Enter .

Now paste the following to obtain a list of current partitions and their details:

List volume details in Command Prompt

Now select the  primary  volume using the cmdlet below.

Replace [Number] in the command with the volume number you see in the table obtained in Step 3 above.

Select a volume

Now remove the assigned drive letter using the following cmdlet.

Replace [Alphabet] with the drive letter currently assigned to this volume.

Unassign dive letter from Command Prompt

Now select the  secondary  volume using the cmdlet below.

Select the secondary volume

Now assign the recently-vacated drive letter from the primary partition to this volume using the given cmdlet.

Replace [Alphabet] with the drive letter initially assigned to the primary volume.

Assign primary drive's letter to the secondary drive using Command Prompt

Now select the primary partition again.

Select the primary volume again

Now assign the drive letter from the secondary partition to this volume.

Assign the secondary drive's letter to the primary drive

The drive letters have been swapped successfully. You can now close the Command Prompt.

You can apply similar logic to other methods to swap drive letters between 2 or more drives. This can be done using Windows PowerShell, Windows Registry, and the Drive Letter Changer software.

How to Fix Affected Programs After Changing Drive Letter

As we already mentioned, changing a drive letter where an app or program may be installed might break it. If the problem is not fixed automatically after a reboot, you may have to fix it manually. Here are a few solutions that might work.

Change Path for Shortcut

If you are trying to run an app or program using its shortcut, then just fixing the path of the shortcut might fix the problem.

Right-click on the shortcut and click  Properties .

Open item properties

Switch to the Shortcut tab, change the drive letters in the “ Target ” and “ Start in ” fields with the new drive letters, and then continue to click Apply and Ok .

Fix issue with apps affected by changing drive letters

Now try re-running the program using the shortcut.

Revert Drive Letter

If the issue occurs after changing the drive letter, then you can try changing it back to the old one using the given methods above.

This is not an ideal case, but it will probably solve the problem.

If you do not wish to revert to the drive letter, you can skip this method and try out the ones discussed below.

Change Drive Letter in Windows Registry

Open the Registry Editor

From the Registry Editor, click Edit and then click Find .

Search inside the Registry Editor

Type in the old location for the app you are trying to troubleshoot, and then click “ Find Next .”

Look for old path inside Windows Registry

When the search wizard finds a match, double-click on the Value in the right pane, and then change the old drive letter with the new one in the text field under “ Value Data .”

Fix app issue caused by changing drive letter from Windows Registry

Now repeat steps 2 through 5 until all paths have been updated with the new drive letter.

Once done, close the Registry Editor and restart the computer for the changes to take effect.

After the computer reboots, check to see if the issue has been resolved.

Reinstall Program

If none of these methods have worked for you, you can try reinstalling the program. Simply delete the app, download the new setup from the vendor’s website, and perform a new install.

Closing Words

People often mistake the drive letter for the name of the volume. However, these 2 are totally different. A drive letter is an alphabet defining a volume/partition on the disk, whereas a name could be anything you want it to be.

By default, Windows names a new volume as “New Volume.” You can change the name of the system volume, but cannot change its drive letter.

That said, we would like to know what prompted you to change the drive letter(s) on your system.

Get Updates in Your Inbox

Sign up for the regular updates and be the first to know about the latest tech information

Email Address

  • 2 Ways To Change Touchpad Sensitivity On Windows 11
  • 2 Ways to Change Power Modes in Windows 11
  • 6 Ways To Open Task Manager In Windows 11
  • 3 Ways To Change Primary Monitor In Windows 11/10
  • 2 Ways To Enable Dark Mode in Windows 11
  • 3 Ways to Open Snip and Sketch in Windows 11

how do i change a drive letter in command prompt

Leave the first comment (Cancel Reply)

Notify me of follow-up comments by email.

Notify me of new posts by email.

How To Turn Off Safe Search On Google Bing

At the edge of tweaking

Advertisement

Change the drive letter in the command prompt

  • Open an elevated command prompt .
  • Type diskpart .

Windows 10 Diskpart List Volume

You are done.

Change the drive letter in PowerShell

  • Open an elevated PowerShell instance .

Windows 10 PowerShell Get Partition

For example, the command can look as follows:

PowerShell Assign Drive Letter

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

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer 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 . View all posts by Sergey Tkachenko

One thought on “How to Change Drive Letter in Windows 10”

Really thank you this steps very helpful

Leave a Reply Cancel reply

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

transparent

Privacy Overview

css.php

How-To Geek

How to change a drive letter on windows 10 or windows 11.

You can change your drive letters in Windows 10 and 11 using the Disk Management utility.

Quick Links

What changing a drive letter does, how to change a drive letter, how to fix programs broken by changing a drive letter.

Changing the letter of a drive is easy on Windows 10 and Windows 11, but you should do it as soon as you add the drive to prevent future hassles. Find out how to change a drive letter here.

Windows assigns drive letters alphabetically --- starting with C --- when they're initialized. If you want to change a drive letter, you should do it before you install anything on the drive. Changing a drive letter after programs are installed could break them since there will be references to an installation location that is no longer there.

Windows has gotten pretty smart about updating shortcuts so that programs work after changing a drive letter. Most of your applications' shortcuts will probably be automatically corrected. Unfortunately, Windows isn't as good about updating file associations. You'll have to manually set the default apps associated with files to fix file associations if they were broken by changing the drive letter.

It is possible to change the boot drive letter to something else, but we don't recommend it. Changing C:\ to another letter is likely to result in severe issues, like a PC that cannot boot into Windows at all. Even if it were able to boot, there would be a huge number of programs that would not be able to run.

Technically speaking, while they are commonly called drive letters, each letter actually refers to a partition on a disk. If you have multiple partitions on a single disk, you will need to assign a letter to each partition to make them all accessible. If a disk has just a single partition, it will just have a single letter pointing to that partition. (However, you do not have to assign a letter to each partition. Partitions without drive letters will not appear in File Explorer and elsewhere.)

Changing a drive letter is pretty simple. Click the Start button, type "Disk Management" in the search bar, and then hit Enter.

The program name displayed in the search will not be Disk Management. It will be "Create and format hard disk partitions."

Start menu search showing disk manager result is not called disk manager

You could also hit Windows+X or right-click the Start button, and then click "Disk Management."

Click

Identify the drive you'd like to change in the Disk Management Window. In this example, we'll change the letter of the D:\ drive to J:\. You can right-click the drive on the text list, or on the menu below. Either works.

Right click the drive in the list, or right click the drive on the menu at the bottom.

Select "Change Drive Letter and Paths" in the right-click menu that appears.

Click

In the window that pops up, click "Change."

Click

Select whatever letter you want from the drop-down menu. Then click "Ok."

Select letter from drop down menu, then click

Two popups will warn you about changing your drive letter. Click "Yes" on both of them, and then restart your computer.

Once Windows has restarted, the drive letter should be changed.

Arrow pointing to change drive letter.

There are a few ways you can fix a program broken by changing the drive letter.

Fix The Shortcut

If you're lucky, the only thing that is broken is the shortcut. Fix a shortcut by right-clicking the shortcut on your desktop, and then click Properties.

Click

You need to change the target of the shortcut to the new drive letter.

For example, if GIMP was previously installed at " D :\GIMP 2\bin\gimp-2.10.exe," and you changed the D drive to J, change the target of the shortcut to " J :\GIMP 2\bin\gimp-2.10.exe."

Finalize the change by clicking "Apply" and then "Ok."

Edit the shortcut. Then click

Reinstall the Program

Reinstalling the program will generate new entries in the registry, so everything on the computer will know where to look for the program. Some installers won't like reinstalling directly over existing files, so you may need to rename or delete the old installation first.

Change the Drive Letter Back

If you changed the drive letter of a drive with a lot of programs installed, it might be easier to change the drive letter back. Changing the drive letter back should automatically fix any programs and file associations that were broken.

Edit the Registry

You can break programs, or even Windows itself, by editing the registry. Be careful, and learn about how to edit the registry before you try it. Make sure you backup the Windows registry first. You should not attempt this method unless you have no other options.

Windows, and a lot of programs, track where programs are installed via the Windows registry. It is possible to manually adjust the registry to fix broken programs. Keep in mind that there could be dozens of registry entries you need to edit. A program like GIMP can have registry entries for the context menu, for the "Open With" menu, for any file associations, and for the location of its executables. Other programs may only have a few entries related to where it is installed.

If you're not deterred, here's how you do it.

First, you need to know where the program was previously installed. In this case, the program was installed to the "D:\GIMP 2" folder, and the executables were found the "D:\GIMP 2\bin" sub-folder. It is now located at "J:\GIMP 2" instead.

We need to update the registry to reflect the change in location. Click the Start button, type "regedit" into the search bar, right-click Regedit, and click "Run as administrator."

Click

In Regedit, hit Ctrl+F to bring up a search window. Type in the old location for the program you're trying to fix --- "D:\GIMP 2" for our example --- then click "Find Next."

Click

Once Regedit has found something with "D:\GIMP 2" as part of a path, it'll show it to you. Here is an example from the GIMP search.

Some of the GIMP search results found in the registry.

To actually change them, double click the name of the registry entry you want to modify. Then change the drive letter to J, or whatever you chose. If you didn't otherwise move the folder, leave the rest of the path alone. Then click "Ok."

Change the drive letter in Value Data.

You'll need to repeat this multiple times. To find the next result using your search term, you can hit the F3 key. There will be a popup once you've found all of the entries.

Changing drive letters can be a simple way to customize your PC. Do it before you install anything on the drive, however. You'll prevent any problems before they occur, and probably save yourself quite a bit of troubleshooting.

  • About the Authors

How to Change Drive Letter in Windows?

The operating system automatically assigns a letter whenever you connect any drive to a Windows computer, either internal or external. The same goes for mapping a network drive and creating a new partition.

By default, when assigning a letter for a disk or partition, Windows goes from the top of the alphabet to the bottom, skipping letters A and B — reserved for floppy drives (yes, still a thing.)

The C drive is always a system drive — you cannot change it and should not even try. At the same time, drive D is typically assigned to the optical drive. The next drive you connect to your computer gets the letters E, F, etc.

change drive letter cmd

What if you didn’t like the letter automatically assigned to your other drives? The good news is you don’t need any third-party apps to change drive letters. Windows has options to use built-in tools and are not so complicated.

Before you proceed, be aware that changing drive letters requires administrator privileges on the local computer. This post uses Windows 11 for demonstration, but the procedure should apply to Windows 10, Windows Servers 2016, and later.

Note . Read our tutorial on  how to remove System Reserved Partition in Windows .

Table of Contents

Change Drive Letter on Windows 11 using Disk Management

Remember that you need Administrator privileges to change a drive letter in Windows 10. Also, our manual applies to any disk, including USB thumb drives, external SSD, network drives, etc.

cmd change drive letter

The drive letter is now changed.

disk management change drive letter

Change Drive Letter on Windows 11 using DISKPART

Another way to change the drive letters on Windows 11 is the old-school tool called diskpart . Diskpart is a command-line utility in Windows that allows users to manage and manipulate disk partitions on their computers, including changing drive letters.

  • Run PowerShell or CMD as administrator.
  • Run the following command to enter the DISKPART prompt: diskpart

change drive letter diskpart

Change Drive Letter on Windows 11 using Set-Partition

PowerShell has a cmdlet called Set-Partition. This cmdlet is explicitly designed to set partition attributes, such as the drive letter. This cmdlet is part of the Storage module, which is built-in to Windows.

The syntax to change a drive letter is as follows.

But first, let’s confirm the available volumes on the computer to ensure we’re changing the correct drive letter. You can run any of the below commands.

change drive letter powershell

To change a partition’s drive letter from E to X, run the below command in PowerShell as admin:

Set-Partition -DriveLetter E -NewDriveLetter X Get-Volume

Drive E is now X.

how to change drive letter set partition

The Disk Management method is probably the most accessible option, especially to those who prefer the point-and-click operation.

Using the DISKPART command is a proven reliable way to change a drive letter in the command line. But using it involves too many steps just for renaming a drive letter, which can be confusing for regular users.

The Set-Partition cmdlet is probably the most convenient, quick, and straightforward method. The simplicity of its syntax to change a drive letter makes it easy to understand and execute.

Following the steps outlined in this blog post, you can easily modify the drive letter assignment for your storage devices to suit your preferences or resolve conflicts. Remember to exercise caution and ensure that you’re selecting the correct drive when making any changes.

kardashevsky cyril

Cyril Kardashevsky

I enjoy technology and developing websites. Since 2012 I'm running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.

PowerShell: Using Grep Equivalent Select-String

Configure access based enumeration on windows server 2016, leave a comment cancel reply.

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed .

The Best Windows Disk Partition Manager and PC Optimizer

how do i change a drive letter in command prompt

  • DiskPart Command Line Utility >

[Free Guide]: Use Diskpart Assign Drive Letter in Windows 11, 10, 8, 7

This post will show you how to use Diskpart assign drive letter in Windows 11, 10, 8, 7. In addition, another free GUI software will be introduced to assign or remove the drive letters.

Cherry

By Cherry / Updated on November 9, 2023

twitter

│ Use Diskpart to assign drive letter

│ assign drive letter via disk management, faqs about how to use diskpart to assign drive letter, why use diskpart to assign a drive letter.

As we all know, Windows assigns drive letters to all available drives on your computer, such as internal hard drives, optical drives, SD cards, and external USB drives. A drive letter is an alphabetical identifier for a volume, and each drive letter can be used once on a computer.

But sometimes, users want to change the original drive letter to another drive letter. Or due to some operation, the drive letter will not be available and the user needs to assign a new drive letter. So a computer-experienced user might assign drive letter by Diskpart, as this is the faster way. The purpose of this article is to provide you with some methods for assigning a drive letter , including Diskpart, Disk Management, and another easier way.

Step-by-step: Assign drive letter by Windows built-in tools

Windows OS users know they have two amazing tools for managing disks and partitions - Disk Management and Diskpart.

The Disk Management tool in Windows provides you with an easy-to-use graphical interface to manage your disks with a single mouse click. And Diskpart is a command-line tool that allows you to quickly manage your disks or partitions from the command prompt. The next section will show you how to use Disk Management and Diskpart to assign drive letters.

Diskpart is a Windows built-in tool that you can use to manage your hard drive, like format disk partition, create partition, delete partition , etc. Well, how to use Command Prompt Diskpart assign drive letter? The following parts may help you a lot.

Step 1. Press "Windows + R". Then, type "diskpart" and press Enter.

Step 2. Type in "list volume" and press Enter. Now, you can see all volumes on PC.

Step 3. Type in "select volume 7" and press Enter(here take volume 7 as an example).

Step 4. Finally, type in“assign letter=F” and press Enter.

If you want to remove the drive letter, type “remove letter=X”(X is the drive letter you want to remove).

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. 

In addition to Diskpart, Disk Management may be another good choice to assign drive letter.

Step 1. Press “Win + R” to open the “Run” window and type diskmgmt.msc in the box.

Step 2. Right-click the drive you want to assign, and select change Drive Letter and Paths in the pop-up window.

change drive letter and path

Step 3. Click Change to summon the next window.

change

Notice: If you want to remove the drive letter of your partition, you can select "Remove" and follow the instructions step by step.

Step 4. After that, you should choose the new drive letter from the drop list, and then, click OK.

assign new letter

Now, do you understand how to use Disk Management and Diskpart assign drive letter?

Although it's convenient for most people, you need to be aware that sometimes you can't assign drive letter successfully, because Disk Management and Diskpart only support assigning drive letter with FAT or NTFS. When the drive's file system is another type, you can format it to NTFS or FAT, or use another method to assign a drive letter.

Diskpart assign drive letter alternative

Disk Management and Diskpart are not perfect because they have limitations. Fortunately, there is an easier way to make up for their shortcomings perfectly.

AOMEI Partition Assistant Standard is a completely free third-party partition manager. It supports users to assign drive letters through a more friendly interface, which can be done with just a few clicks, much simpler than Diskpart. Also, it can assign drive letter on any file system. More importantly, it has more complete functions and allows you to manage disks flexibly.

Step 1. 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.

Assign Drive Letter

Step 2. Then, select a drive letter for the drive.

Choose New Drive Letter

Step 3. Click Apply to submit the task.

Apply Assign Drive Letter

Now, do you know how to use Diskpart assign drive letter? If you are a user who has a computer background, Diskpart may be the quickest method to assign the drive letter. However, if you are normal user, AOMEI Partition Assistant Standard is the correct choice.  After you upgrade to AOMEI Partition Assistant Professional , there are more advanced features you can try, such as allocating free space from one drive to C, and Move the installed app from one drive to another.

Last but not least, although the system drive letter can be changed, do not do it because that would make the system unable to boot.

Can I remove a drive letter assignment using Diskpart? Yes, you can remove a drive letter assignment by using the "remove" command. For example, "remove letter=E" will remove the E drive letter from the selected volume.

Are there any restrictions on the drive letters I can assign using Diskpart? Drive letters A and B are traditionally reserved for floppy disk drives. You can assign any available drive letter from C to Z to a partition or volume, provided it's not already in use.

Do I need to be careful when using Diskpart to avoid data loss? Yes, you should be cautious when using Diskpart, especially if you're deleting partitions or making significant changes to disk configurations. Make sure you select the correct volume and drive letter to avoid accidental data loss.

Can I assign drive letter on a hidden drive? Yes, you can. Be very cautious when assigning a drive letter to a hidden drive or volume, as it might contain system or recovery files.

Press the Windows key, type "cmd" or "Command Prompt," right-click it, and choose "Run as administrator". In the Command Prompt window, type "diskpart" and press Enter. This will open the Diskpart utility. To see a list of all volumes, including hidden ones, type list volume and press Enter. Use the "select volume" command to choose the hidden volume. Replace "X" with the volume number or letter. A ssign a drive letter to the selected hidden volume, use the "assign letter=Y" command. Once you've successfully assigned the drive letter, you can exit Diskpart.

Cherry

Related Articles

How to permanently assign drive letter with ease.

A permanent drive letter prevents us from being confused with multiple USB drives. Then, how to permanently assign drive letter with ease? This post offers three effective ways to make it.

Drive Letter Not Available-Why and How to Solve It?

Can’t assign drive letter in Disk Management because a certain drive letter is not available? Follow this article to solve it efficiently.

How to Change Partition Type ID Easily? (2 Ways Included)

Are you in need of changing partition type ID in Windows? Read this article thoroughly to get two efficient methods to modify partition type ID.

Free Download to Try AOMEI Partition Assistant Now

How to change drive letter on Windows 11

Here are four ways to assign a different letter to a drive on Windows 11.

Avatar for Mauro Huculak

On Windows 11 , a “drive letter” is automatically assigned to each internal storage, USB drive, DVD drive, and map network drive to identify the volume and make it available on File Explorer or other applications. However, you can change the drive letter to anything you want without deleting the data on the storage. For instance, if you want a drive to use a specific letter related to the content, or the system tries to assign a letter already in use, preventing the storage from appearing on File Explorer and apps.

Whatever the reason, on Windows 11, you can assign a different drive letter in at least four ways using the Settings app, Disk Management, Command Prompt, and PowerShell.

A drive letter (or device letter) can be any character from the English alphabet. However, you cannot use the “C:” because it’s reserved for the main storage that contains the installation. Also, “A:” and “B:” are reserved letters that used to be assigned automatically to floppy drives.

This guide will teach you how to assign a new drive letter on Windows 11.

Change drive letter on Windows 11

  • Change drive letter from Disk Management on Windows 11

Change drive letter from Command Prompt on Windows 11

Change drive letter from powershell on windows 11.

To change the drive letter on Windows 11, use these steps:

Open Settings on Windows 11.

Click on System .

Click the Storage tab.

Under the “Storage management” section, click the “Advanced storage settings” option.

Click on Disks & volumes .

Open Disks & volumes

Select the drive with the volume with the letter to change.

Select the volume and click the Properties button.

Open driver properties

Click the “Change drive letter” button.

Change drive letter

Select the new drive letter for the device connected to Windows 11.

Assign drive letter on Windows 11

Click the OK button.

Once you complete the steps, the system will change the drive’s letter on Windows 11.

Change drive letter from Disk Management

To change the drive letter with Disk Management, use these steps:

Open Start .

Search for Create and format disk partitions and click the top result to open the Disk Management tool.

Right-click the volume and select the “Change Drive Letter and Paths” option.

Change drive letter and paths

Click the Change button.

Disk Management change drive letter

Select the “Assign the following drive letter” option.

Choose a different letter for the drive.

Disk Management assign new drive letter

Click the OK button again.

After completing the steps, the drive will appear in File Explorer with the new letter.

To add a new drive letter with Command Prompt, use these steps:

Search for Command Prompt , right-click the result, and select the Run as administrator option.

Type the following command to launch diskpart and press Enter :

Type the following command to list the volumes and press Enter :

Type the following command to select the volume (drive) to change the letter and press Enter :

In the command, change “2” for the number corresponding to the storage you want to change the letter.

Type the following command to change the drive letter on Windows 11 and press Enter :

In the command, change “H” for the letter you want to use with the drive.

DiskPart change drive letter

Once you complete the steps, the diskpart tool will assign the new letter to the storage.

To change a Windows 11 drive letter with PowerShell, use these steps:

Search for PowerShell , right-click the result, and select the Run as administrator option.

Type the following command to identify the hard drive to change the letter and press Enter :

Type the following command to assign or change the drive letter to internal or external and press Enter :

In the above command, change “0” with the disk number of the drive you want to format and “F:” with the letter you wish to assign to the storage.

PowerShell change drive letter

After completing the steps, the drive will have a new letter assignment. If the drive was previously missing, it will appear in File Explorer.

Avatar for Mauro Huculak

Mauro Huculak is a Windows expert and the Editor-in-Chief who started Pureinfotech in 2010 as an independent online publication. He is also been a Windows Central contributor for nearly a decade. Mauro has over 12 years of experience writing comprehensive guides and creating professional videos about Windows, software, and related technologies, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter) , YouTube , LinkedIn and About.me .

  • How to upgrade Windows 7 to Windows 10 using clean install process
  • How to reset Settings app on Windows 10

We hate spam as much as you! Unsubscribe any time Powered by follow.it ( Privacy ), our Privacy .

Computer Hope

How to change drives in MS-DOS and Windows command line

C: prompt

To change the drive letter in MS-DOS, type the drive letter followed by a colon . For example, if you wanted to switch to the floppy disk drive, you would type a: at the prompt. Below is a listing of common drive letters and their corresponding devices.

A partition is also treated as a drive, which means if you have a hard drive with two partitions , it's the C: and D: drive letters.

Floppy disk drive (commonly the 3.5" floppy drive).

A second floppy disk drive, if present (commonly the 5.25" floppy drive).

Computer hard drive primary partition (unless the hard drive is not available or is bad). If your CD-ROM (compact disc read-only memory) is the C: drive, your computer is not detecting the hard drive.

Commonly the CD-ROM drive or another drive unless the computer hard drive has multiple partitions . If multiple partitions exist, your CD-ROM drive is the last letter. For example, if one extended partition exists, your CD-ROM drive will be the E: drive because the hard drive partitions would use C: and D: drive letters.

Accessing a USB drive

To access a USB thumb drive or external drive, you must know what drive letter the computer has assigned to the drive. For example, if the USB (universal serial bus) is assigned to the F: drive, you can type f: at the prompt to switch to the F: drive.

What happens after switching drives?

After pressing Enter , your computer should change the MS-DOS prompt to reflect the new drive letter. If the drive does not exist, you will receive an error similar to the error below.

If this occurs and you know the drive exists, it's likely the drive is having problems.

If the drive and drive letter do exist, but there is no media to read, then you'll get the below error.

For example, the error above will be received if you switch the drive with no floppy disk or CD (compact disc) inside.

To list the files on an alternate drive, you can also type dir followed by the drive letter. For example, "dir a:" lists the files on the floppy drive but will not switch your prompt to the floppy drive.

Related information

  • How to see all drives available on the computer.
  • How to change a drive letter.
  • How to use the Windows command line (DOS).
  • How to copy files.
  • How to move files and folders on the computer.
  • See our drive definition for further information and related links.
  • MS-DOS and Windows command line help and support.

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Cannot change drive letter in command prompt (cmd) other than C:\ [duplicate]

Not sure what might have triggered this but I have noticed that while using the command prompt in windows 10 I am unable to change the drive using the cd command for any of the drive letters other than C:. I have also noticed that the autocomplete function works just fine when trying to change directory into a specific folder from the target drive but the change in the directory just doesn't happen.

Screenshots of the Disk Management tool and actual cmd prompt commands will follow:

Disk Management

Command Prompt

This behavior does not apply to PowerShell so I can successfully change the drives.

Isaz's user avatar

3 Answers 3

That's normal. For historical reasons, that's just how the cd command works in Cmd.exe, because that's how it worked in MS-DOS COMMAND.COM as well. The directory change is remembered (Cmd tracks it per-drive, as did MS-DOS), but you have to switch the actual drive separately – by typing just the drive:

The opposite would also work even though it would be very un-obvious:

(And note that when you use e.g. cd e: in your screenshot, this doesn't change anything, rather it shows you the current directory for that drive letter.)

However, Cmd.exe has a shortcut for changing both – the /d option makes cd work sanely:

The pushd/popd commands do not require amything extra, as they weren't present in MS-DOS and aren't burdened with compatibility. (I used to use doskey aliases [=pushd $* and ]=popd a lot.)

u1686_grawity's user avatar

  • +1 for mentioning pushd / popd as these work for network drives –  Dean Meehan Jul 1, 2020 at 17:46
  • So you are telling me that after using windows for more than 20 years it's the first time I needed to change the drive and I've always needed to use /d in order to accomplish that? –  Isaz Jul 1, 2020 at 20:56
  • @Isaz: ¯\_(ツ)_/¯ –  u1686_grawity Jul 1, 2020 at 21:40

cd [drive]:\directory will change the current directory “context” on that drive but won’t change to that drive itself.

If you subsequently just type [drive]:, it’ll change to that drive and remember the directory you previously “cd”’ed into.

CMD has always behaved like this.

PowerShell’s “cd” is an alias to Set-Location, which always changes the current drive as well as directory.

Greg W's user avatar

Just type the drive letter

Rajiv's user avatar

Not the answer you're looking for? Browse other questions tagged windows-10 .

  • The Overflow Blog
  • Who owns this tool? You need a software component catalog
  • Down the rabbit hole in the Stack Exchange network
  • Featured on Meta
  • Upcoming privacy updates: removal of the Activity data section and Google...
  • Changing how community leadership works on Stack Exchange: a proposal and...

Hot Network Questions

  • Industrial applications of high gravity
  • Clarification of the loop response of a TPS54350 buck converter (LTspice)
  • When ordering off Amazon, are you allowed to keep a product that's significantly more valuable than what you originally ordered?
  • Floating point numbers... dar nu-mă, nu-mă iei!
  • How do airlines make money or get some other kind of advantage when I book a flight using miles not earned from flying?
  • What's the source of John Adams's quote against the two-party system?
  • Is there global law that governs Denaturalization to stateless status for children?
  • Are cherry blossoms ever used in cooking for their flavor? Is there a preference between ornamental and agricultural varieties?
  • What would you do with a new model of linear logic?
  • "They don’t speak it so much my side of the park." Which park? Which side is which?
  • Why deplane all passengers and not the troublemaker?
  • How do I handle white space in cards with varying amounts of information?
  • Horror short story set on Everest, where climbers left behind are eaten by a creature masquerading as a climber
  • What systems actually used the ACCT command in FTP?
  • What is a misreading error called?
  • States' check on federal government's power?
  • How do I interpret low subgroup interaction and high efficacy in only one group?
  • Are views logically redundant?
  • Is there an evil god?
  • Would it be constitutional for a US state or the federal government to ban all homeopathic "medications"?
  • How do I write a sexist narrator without coming off as sexist myself?
  • How do you invisibly connect polymer ball chains?
  • How to say "(regional/national) identity" in Chinese?
  • Visualizing the reverse pyramid in a good way

how do i change a drive letter in command prompt

Affiliate links on Android Authority may earn us a commission. Learn more.

How to change directory or drive in Command Prompt

The Windows Command Prompt can be a little intimidating if you didn’t grow up using DOS — and even then, it’s been long enough since DOS was relevant that you may have forgotten. Below we’ll cover some of the most basic aspects of Command Prompt, namely navigating drives and directories/folders.

QUICK ANSWER

To open Command Prompt, click the Start button and search for CMD . Within the app, use cd [folder]/[subfolder] to go down directories, and cd .. to go up a level. Changes drives by typing [drive letter]: . Use dir to see folder contents. Hit the Enter key to launch any of these commands.

JUMP TO KEY SECTIONS

How to change directories in Command Prompt

How to change drives in command prompt, by navigating in command prompt.

Navigating directories in Command Prompt

There are a few different options to know for keyboard navigation, most involving the cd command. Hit Enter to run each one.

  • Type dir at any time to see directory contents.
  • Type cd [folder name] to switch to a folder under your existing one. cd Music , for example.
  • Type cd [folder]/[subfolder] to skip down multiple directories. You can add as many subfolders as needed.
  • To go up a directory level, type cd .. (use both periods).

By dragging and dropping a folder

This approach makes Command Prompt slightly more convenient if you don’t like rooting through directory structures with your keyboard, but still need to see them in text form.

  • Type cd followed by a blank space.
  • In Explorer, drag and drop the folder you want to browse into Command Prompt.
  • Hit Enter .

Changing the drive you’re navigating is very easy — just type [drive letter]: and hit Enter , for instance e: . At that point, you can explore directories using the methods above.

If you want to combine directory and drive navigation, use cd /d [drive/folder] . To go to the Windows folder from anywhere, example, you’d usually type cd /d c:/Windows  since C:/ is the default drive letter for Windows PCs.

How To Change Drive in CMD

how to change drive in cmd

In the Windows command prompt (CMD), we use the cd command to change from one directory to another. However, it only changes the path inside the current drive by default.

If you want to change to a different drive in CMD, you need to use the /d switch.

For example, I am working on the command prompt, inside the C:\Users\user1 folder. Now I want to move into a folder called data which is in the D: drive.

command prompt change drive

In the above screenshot, you can see that the command didn't work. The solution is to use the /d switch.

how to change drive in command prompt

Alternatively, simply enter the drive letter followed by a colon, as follows:

However, this method only changes to the root of the drive. If you want to go to a folder, you have to use the CD command .

IMAGES

  1. How to Change Drive Letter with CMD Windows 10

    how do i change a drive letter in command prompt

  2. How to Change/Rename/Assign Drive Letter in CMD Windows 10/7

    how do i change a drive letter in command prompt

  3. Windows 10 change drive letters

    how do i change a drive letter in command prompt

  4. [Solved] How to Change Drive Letter on Windows 11

    how do i change a drive letter in command prompt

  5. Change drive letters via the command prompt in Windows 11, 10

    how do i change a drive letter in command prompt

  6. How to Change Drive Letter in Windows 10?

    how do i change a drive letter in command prompt

VIDEO

  1. How to Change Drive Letter in Windows 11

  2. How to Change Drive Letter in Windows 10

  3. How to Change Drive Letter in Windows 11/10

  4. WIndows XP How to Change Drive Letter

  5. How to Change Drive Letter in Windows 11/10 (EASY)

  6. CMD command change letter color how?

COMMENTS

  1. Manually assigning a drive letter using CMD/Diskpart

    Open up a command prompt (CMD/PowerShell). Type "diskpart" to start up diskpart. You will see the prompt change to "DISKPART>". Type "list vol" to list all available volumes. You can identify the drive by size and file system. Additionally, the volume doesn't currently have a drive letter. Select the volume using "sel vol <number>".

  2. windows 10 cmd prompt change directory to drive on different physical

    I was using the command C:\> cd /E E:\specific\directory where I thought the switch flag was to use the letter for which drive you wanted to switch to, i.e. switch /E for the E:\ drive.

  3. How to Use the Diskpart Utility to Assign and Remove Drive Letters

    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. list volume

  4. How to Change Drive Letter with CMD Windows 10

    You can press Windows + R, type cmd, and press Ctrl + Shift + Enter to open elevated Command Prompt. Step 2. Open Diskpart tool In Command Prompt window, you can type diskpart command, and press Enter. This will open the Diskpart command-line utility. Step 3. Change drive letter CMD

  5. How to Remove and Assign Drive Letters in Windows with Diskpart

    diskpart 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. list volume

  6. Change a drive letter

    In Disk Management, select and hold (or right-click) the volume on which you want to change or add a drive letter and select Change Drive Letter and Paths. Tip If you don't see the Change Drive Letter and Paths option or it's grayed out, the volume either isn't ready to receive a drive letter or it's unallocated and needs to be initialized.

  7. How to assign permanent letters to drives on Windows 10

    Type the following command to select the volume (drive) to assign a new letter and press Enter: select volume 3 In the command, make sure to change "3" to the number that represents the...

  8. Change Drive Letter Using Command Prompt In Windows 10/8/7 [Tutorial]

    Change Drive Letter Using Command Prompt In Windows 10/8/7 [Tutorial]Sometimes Windows system drive letters get altered, and the Control Panel's Disk Managem...

  9. How to Change Drive Letter in Windows 10 & 11

    Press " Win + R " to open Run. Type " diskmgmt.msc " and click " Ok .". Find the drive you want to modify. Right-click on the drive. Choose the " Change drive letter and paths " option. Click the " Change " button. Select the " Assign the following drive letter " radio option. Choose a drive letter from the dropdown.

  10. 5 Ways To Change Drive Letter In Windows 11, 10

    Right-click on the shortcut and click Properties. Open item properties. Switch to the Shortcut tab, change the drive letters in the " Target " and " Start in " fields with the new drive letters, and then continue to click Apply and Ok. Fix issues with apps affected by changing drive letters.

  11. Diskpart

    More on the blog: https://bit.ly/31NoF4GAssign drive letters in the command line with Diskpart.Start a command prompt and type "diskpart". Then you can use "...

  12. How to Change Drive Letter in Windows 10

    Press the Win + X keys together. In the menu, select Disk Management. 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. In the next dialog, click on the Change... button.

  13. How to Change a Drive Letter on Windows 10 or Windows 11

    You could also hit Windows+X or right-click the Start button, and then click "Disk Management." Identify the drive you'd like to change in the Disk Management Window. In this example, we'll change the letter of the D:\ drive to J:\.

  14. Change and Assign Drive Letter in Windows 10

    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: "F") you want to add or change the drive letter, and click/tap on Change Drive Letter and Paths. (see screenshot below) 3 Click/tap on the Change button. (see screenshot below)

  15. How to Change Drive Letter in Windows?

    Press Win+X and click Disk Management. Alternatively, press Win+R and run the diskmgmt.msc command. Find the drive or partition for which you want to change the letter. In this example, we'll choose the drive E. Right click the volume from the list and click Change Driver Letter and Paths.

  16. [Free Guide]: Use Diskpart Assign Drive Letter in Windows 11, 10, 8, 7

    Step 1. Press "Windows + R". Then, type "diskpart" and press Enter. Step 2. Type in "list volume" and press Enter. Now, you can see all volumes on PC. Step 3. Type in "select volume 7" and press Enter (here take volume 7 as an example). Step 4. Finally, type in"assign letter=F" and press Enter.

  17. How to change drive letter on Windows 11

    Open Start. Search for Create and format disk partitions and click the top result to open the Disk Management tool. Right-click the volume and select the "Change Drive Letter and Paths" option. Click the Change button. Select the "Assign the following drive letter" option. Choose a different letter for the drive.

  18. How to change drives in MS-DOS and Windows command line

    To change the drive letter in MS-DOS, type the drive letter followed by a colon. For example, if you wanted to switch to the floppy disk drive, you would type a: at the prompt. Below is a listing of common drive letters and their corresponding devices. Tip

  19. How to Change Drive Letter on Windows 11

    Right-click on the drive whose letter you want to assign manually and select Change Drive Letter and Paths…. Click on Change…. Now click on the drop-down menu next to "Assign the following drive letter". Select a letter. Click OK. When prompted, click Yes. The drive letter is now changed.

  20. Cannot change drive letter in command prompt (cmd) other than C:\\

    3 Answers Sorted by: 17 That's normal. For historical reasons, that's just how the cd command works in Cmd.exe, because that's how it worked in MS-DOS COMMAND.COM as well. The directory change is remembered (Cmd tracks it per-drive, as did MS-DOS), but you have to switch the actual drive separately - by typing just the drive:

  21. How to change drive letter from command prompt or powershell in windows

    1 Answer Sorted by: 7 Assuming when you said "computer disk" you do not mean the System/Boot Disk, here is a solution using PowerShell. Note the variables. You can either replace them with the actual Drive Letters, or set them ahead of time. Get-Partition -DriveLetter $old | Set-Partition -NewDriveLetter $new

  22. How to change directory or drive in Command Prompt

    How to change drives in Command Prompt Changing the drive you're navigating is very easy — just type [drive letter]: and hit Enter, for instance e:. At that point, you can explore...

  23. How To Change Drive in CMD

    The solution is to use the /d switch. Alternatively, simply enter the drive letter followed by a colon, as follows: D: However, this method only changes to the root of the drive. If you want to go to a folder, you have to use the CD command. Learn how to change the drive in the Windows command prompt when using the CD command.