1

我正在寻找一种删除挂载点的方法(使用 powershell/wmi/C#)。我用win32_volume来查找哪些卷有挂载点,并且可以在那里找到路径(在名称和标题下),但我不知道如何删除这些挂载点。win32_volume命名空间有一个创建它们的方法,但没有什么可删除的。win32_mountpoints是只读的。没有任何运气找到解决方案。

4

3 回答 3

3

PowerShell 社区扩展有一个 Remove-MountPoint cmdlet 。

于 2010-06-25T01:40:35.153 回答
1

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

我将其转换为纯 powershell,因此不依赖于外部模块。

于 2012-05-22T14:54:29.827 回答
0

下面是删除挂载点的powershell命令

# remove the mount point
$Driveletter='E'
Get-Volume -Drive $DriveLetter | Get-Partition | Remove-PartitionAccessPath -accesspath "$DriveLetter`:\"
于 2019-08-30T09:29:45.630 回答