PowerTip: Use PowerShell to Remove Drive Letter

Doctor Scripto

Summary: Learn how to use Windows PowerShell to remove an assigned drive letter from a partition.

Hey, Scripting Guy! Question How can I use Windows PowerShell to remove a drive letter from a partition?

Hey, Scripting Guy! Answer Use a combination of three cmdlets with the drive letter—for example, to remove drive letter X from the drive
           it is assigned to, use

$DriveLetter=’X
Get-Volume -Drive $DriveLetter | Get-Partition | Remove-PartitionAccessPath
-accesspath "$DriveLetter`:\"

0 comments

Discussion is closed.

Feedback usabilla icon