Link to home
Start Free TrialLog in
Avatar of gpchicago08
gpchicago08

asked on

Check before UnMapping Network Drive Letter

I have the following code to Un-Map a drive letter.  What I would like assistance with is code to determine if DriveLetter is actually a mapped network drive.

Public Function UnMapDrive(ByVal DriveLetter As String) As Boolean
          Dim rc As Integer


''''''' - code here to determine if DriveLetter is actually a mapped network drive '''''''


            rc = WNetCancelConnection2(DriveLetter & ":", 0, ForceDisconnect)

                 If rc = 0 Then
                Return True
            Else
                Return False
            End If

          End Function
ASKER CERTIFIED SOLUTION
Avatar of dericstone
dericstone
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gpchicago08
gpchicago08

ASKER

PERFECT! Thanks!