Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF STATMENTS IN VBS MAPNETWORK DRIVE

Status
Not open for further replies.
Oct 8, 2002
62
US
i need help with a conditonal statment.

I want to check if a drive is in use, if not then i want to map a drive, if it is in use then i want it to do nothing.

can anyone help me!!!!!!!!!!!!!
 
Try this,

drv = "E:"
msgbox DriveStatus(drv)

' *************************
Function DriveStatus(drv)
' *************************
Dim Fso
Set Fso = CreateObject("Scripting.FileSystemObject")
If fso.DriveExists(drv) Then
DriveStatus = "True"
Else
DriveStatus = "False"
End If
End Function

fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top