|
うまくいくかどうか分かりませんが、テストしてみて下さい。
ちなみにこちらでは失敗しました。
Sub Net_Drive()
Dim WshNetwork As Object, oDrives As Object
Dim i As Long
Set WshNetwork = CreateObject("WScript.Network")
Set oDrives = WshNetwork.EnumNetworkDrives
For i = 0 To oDrives.Count - 1 Step 2
MsgBox "Drive " & oDrives.Item(i) & _
" = " & oDrives.Item(i + 1)
Next i
Set oDrives = Nothing: Set WshNetwork = Nothing
End Sub
Sub Net_Drive2()
Dim FSO As Object, Dr As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each Dr In FSO.Drives
If Dr.DriveType = 3 Then
MsgBox "ネットワークドライブは " & Dr.DriveLetter & _
vbLf & Dr.ShareName
Exit For
End If
Next
Set FSO = Nothing
End Sub
|
|