listshares.vbs

来自「Apress - Managing Enterprise Systems Wit」· VBS 代码 · 共 13 行

VBS
13
字号
'listshares.vbs
'lists connected network shares
Dim objNetwork, objShares, nf
Set objNetwork = CreateObject("Wscript.Network")
Set objShares = objNetwork.EnumNetworkDrives
'output the first connected share and associated drive letter
Wscript.Echo "Drive " & objShares(0) & " is connected to " & objShares(1)

'loop through all connected shares and output details
For nf = 0 To objShares.Count - 1 Step 2
  Wscript.Echo objShares(nf) & " is connected to " & objShares(nf + 1)
Next

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?