简体   繁体   中英

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

I wants to change my computer disk D:\\ to E:\\ from command prompt or powershell. Is there any way other than 'diskpart'?

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

Note here that $old and $new does not include the : character. So in your particular case (changing from D to E), you can use the following.

Get-Partition -DriveLetter D | Set-Partition -NewDriveLetter E

Note also that you will need Admin Rights. So run PowerShell as Admin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM