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

Get VBScript to wait for network before mapping drive at logon?

Status
Not open for further replies.

mkv39548

Technical User
Sep 9, 2010
1
FR
Hi

I have two windows 7 pro machines that are not part of a domain. They are connected to a hub with net access and a NAS. I have a VBScript that maps folders on the NAS as network drives on the machines at logon and then runs some a program from the mapped drive. Currently I use the WScript.Sleep command to get the script to wait for a network connect before mapping the drives and then to wait again for the mapping before running the program. Is there a better way to do this - such a some code that will wait until these connections have been made, rather than just for a fixed amount of time?

 
each drive mapping is to a \\machinename\share
a simple loop with:
Do
If FSO.FolderExists("\\machinename\share") Then
'safe to go off and map
Exit Do
End If
Loop

i presume the logonscript length of execution doesnt prevent the user from getting on with work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top