香港新浪網 MySinaBlog
« 上一篇 | 下一篇 »
Emily | 2nd Jun 2006, 07:24 AM | Network / Media | (1303 Reads)

Network Drive Mapping

 Sub NetworkMapDrive()

    Set WshNetwork = CreateObject("WScript.Network")
    Set oDrives = WshNetwork.EnumNetworkDrives
    DrivesStr = "Network drive Mappings:" & Chr(13)
    For i = 0 To oDrives.Count - 1 Step 2
       DrivesStr = DrivesStr & "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i + 1) & Chr(13)
    Next
    MsgBox DrivesStr
End Sub
 '

Reference:

Windows Script Host (WSH) Object Model

Windows Script Host(簡稱 WSH)

Script56說明文件繁體版

Script56帮助简体版