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.
Asked
Active
Viewed 5,977 times
1
3 Answers
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
-
These cmdlets are not available to me (Windows 2008 R2, PowerShell 5). – Joost Aug 30 '19 at 14:50
-
1@Joost Powershell cmdlets are specific to OS. This cmdlet available from windows 2012 onwards – Samselvaprabu Sep 03 '19 at 09:46