快速取消所有文件夹共享:
把文件夹共享给别人但忘记取消,想取消共享但找不到那个文件夹了,怎么办?
双击这个工具,可清除所有共享。
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colShares = objWMIService.ExecQuery _
("Select * from Win32_Share Where Name <> ‘C$‘ and Name <> ‘D$‘ and Name <> ‘E$‘ and Name <> ‘F$‘")
For Each objShare in colShares
objShare.Delete
Next
MsgBox "共享目录已清除"
将以上代码另存为.vbs格式的文件就可以了
时间: 2024-10-11 03:23:34