Change Drive Letter Using CMD in Windows 11
Managing drive letters in Windows 11 can be performed quickly using the built-in DiskPart command-line tool within the Command Prompt. This guide provides step-by-step instructions on how to open an elevated Command Prompt, identify your target partition, and assign, modify, or remove its associated drive letter.
Step 1: Open Command Prompt as Administrator
- Press the Windows Key + S to open the Windows Search bar.
- Type
cmd. - Right-click on Command Prompt and select Run as administrator.
- Click Yes if prompted by User Account Control (UAC).
Step 2: Launch the DiskPart Utility
In the Command Prompt window, type the following command and press Enter:
diskpartStep 3: List and Identify the Volumes
To view all available partitions and their current drive letters, run:
list volumeNote the Volume ### number and the current letter assigned to the partition you want to modify.
Step 4: Select the Target Volume
Select the volume you wish to modify by replacing X with
the specific volume number from the list:
select volume X(Example: select volume 3)
Step 5: Assign or Change the Drive Letter
To assign a new drive letter or change an existing one, run the
following command, replacing Y with your preferred drive
letter:
assign letter=Y(Example: assign letter=E)
Note: Ensure the letter you choose is not already in use by another drive or partition.
Optional: Remove a Drive Letter
If you want to unassign or hide a partition’s drive letter without deleting the data, use the remove command:
remove letter=Y(Example: remove letter=E)
Step 6: Exit DiskPart
Once you receive the confirmation message that the operation succeeded, close the utility and Command Prompt:
exitType exit once more or close the window. The new drive
letter will now be active and visible in File Explorer.