Hello,
My drive c:\ is shared as \\computername\c1.
I need to refer to it using its ShareName.
I use the following:
Public Sub test_ShowDriveInfo()
Call ShowDriveInfo("c:\")
End Sub
Sub ShowDriveInfo(drvpath)
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
s = "Drive " & d.DriveLetter & ": - " & d.ShareName
MsgBox s
End Sub
It works OK for network drives. When I refer to local drives, the d.ShareName is empty.
I need to get for “c:\”, d.ShareName =\\computername\c1.
Any ideas?
Thanks
Bookmarks