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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check a drive for availability

Status
Not open for further replies.

426Hemi

Technical User
May 2, 2002
16
US
Is there another way to check a drive other than the Dir command? Dir works for me only when the computer I am trying to access on the network is up and running, otherwise, I receive an error. If the cpu I am trying to access is up and running, this code works

[
availTest = Dir("the path + filename is placed here")

If availTest = "" Then 'empty, no file found

'I send a msg to the user here and exit the procedure

Else

'Access and use the file

End If
]

 
You may try this:
availTest = CreateObject("Scripting.FileSystemObject").FileExists("the path + filename is placed here")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you for your help, that did the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top