OctaFish
Verenigingslid
- Lid geworden
- 6 feb 2009
- Berichten
- 42.021
Kun je hier wat mee?
Code:
Function GetUNC(strMappedDrive As String) As String
Dim objFso As FileSystemObject
Dim strDrive As String
Dim strShare As String
Set objFso = New FileSystemObject
'Separated the mapped letter from
'any following sub-folders
strDrive = objFso.GetDriveName(strMappedDrive)
'find the UNC share name from the mapped letter
strShare = objFso.Drives(strDrive).ShareName
'The Replace function allows for sub-folders
'of the mapped drive
GetUNC = Replace(strMappedDrive, strDrive, strShare)
Set objFso = Nothing 'Destroy the object
End Function