
Originally Posted by
vbbit
I used the getdrivetype but it keeps returning 1 and not 4 and the share itself is disconnected. It should say 4, but it does not.
The DRIVE_NO_ROOT_DIR (1) return value means "The root path is invalid", so if you say that the share is disconnected, then GetDriveType is returning the correct value.
You might also want to try the following (not fully-tested) function:
Code:
Public Function IsDriveReady(ByRef Drive As String) As Boolean
On Error Resume Next
IsDriveReady = CreateObject("Scripting.FileSystemObject").GetDrive(Drive).IsReady
End Function
You can check the DriveType property of the Drive object to see whether it is a network drive.