我想使用vbscript来计算连接到共享文件夹的客户端连接的数量。 我可以使用任何服务,但不是WMIservice。
你为什么不使用WMI?
sComputer = "." sShare = "C$" Set oWMI = GetObject("winmgmts:\\" & sComputer & "\root\cimv2") Set colConnections = oWMI.ExecQuery("ASSOCIATORS OF {Win32_Share.Name=""" & sShare & """} WHERE AssocClass=Win32_ConnectionShare") WScript.Echo colConnections.Count & " open connections on \\" & sComputer & "\" & sShar
(来源: http : //www.webmasterkb.com/Uwe/Forum.aspx/vbscript/12834/VBScript-and-Shares )