by rone (9 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 12th April 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Map Network Drive
ByVal DrivePath As String) As String
Dim WshNetwork As Object
Dim Drive_Exists As Boolean
On Error GoTo ErrHandler
Set WshNetwork = CreateObject("Wscript.Network")
Call WshNetwork.MapNetworkDrive(DriveLetter, DrivePath)
Set WshNetwork = Nothing
Exit Function
ErrHandler:
Set fso = Nothing
Set WshNetwork = Nothing
MsgBox " Error Description: " & Err.Description
End Function