1

I am looking for a way to remove a mount point (with either powershell/wmi/C#). I used the win32_volume to find what volumes have mount points and can find the path there (under name and caption) but I can't figure out how to delete those mount points. The win32_volume namespace has a method to create them but nothing to delete. The win32_mountpoints is read only. Haven't had any luck finding a solution.

Itchydon
  • 2,572
  • 6
  • 19
  • 33
Justin
  • 21
  • 1
  • 3

3 Answers3

3

The PowerShell Community Extensions has a Remove-MountPoint cmdlet.

Keith Hill
  • 194,368
  • 42
  • 353
  • 369
1

http://jrich523.wordpress.com/2012/04/27/powershell-remove-a-drive-mountletter-more-win32/

I converted it to pure powershell so there is no dependencies on external modules.

jrich523
  • 598
  • 1
  • 5
  • 19
0

Below is the powershell commands to remove mount points

# remove the mount point
$Driveletter='E'
Get-Volume -Drive $DriveLetter | Get-Partition | Remove-PartitionAccessPath -accesspath "$DriveLetter`:\"
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230