Does anyone out there know how to get the full UNC path of a file name that is reference by its logical drive, and vice versa.
Eg. i:\windows --> \\server1\install\windows
\\server2\data --> g:\
Printable View
Does anyone out there know how to get the full UNC path of a file name that is reference by its logical drive, and vice versa.
Eg. i:\windows --> \\server1\install\windows
\\server2\data --> g:\
I don't think there's a built-in function but this may help point you in the right direction - the FSO (File System Object) is very handy for file/drive related stuff. In order to use it you will need to go to PROJECT / REFERENCES and add Microsoft Scripting Runtime (SCRRUN.DLL)
Code:Dim fso As New FileSystemObject
Dim fDrive As Drive
For Each fDrive In fso.Drives
Debug.Print fDrive.ShareName, fDrive.Path, Choose(fDrive.DriveType + 1, "Unknown", "Removable", "Fixed", "Remote", "CDROM", "RAM")
Next