投稿日 | : 2007/02/22(Thu) 10:17 |
投稿者 | : Blue |
Eメール | : |
URL | : |
タイトル | : Re: ネットワークドライブの接続先を知りたい。 |
FileSystemObjectのDrivesから列挙されるDirveオブジェクトの
ShareNameプロパティを確認する。
Sample)
Dim objFSO As Object
Dim objDrive As Object
Dim targetPath As String
targetPath = "\\192.168.1.1\TMP"
Set objFSO = CreateObject("Scripting.FileSystemObject")
For Each objDrive In objFSO.Drives
' ネットワーク ドライブか
If objDrive.DriveType = 3 Then
If targetPath = objDrive.ShareName Then
MsgBox objDrive.Path
Exit For
End If
End If
Next
Set objFSO = Nothing