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

Logon Script To Map Drive Needs Pause - Question

Status
Not open for further replies.

sageturkey

IS-IT--Management
Apr 10, 2003
13
0
0
US
Newbie to VBS -
I have a simple logon script that I have included in a Custom VPN connection using CMAK. The .vbs script works great when ran stand-alone after the VPN connection is established, but when included in the Custom Connection, even though set to run post-logon, it runs too soon after the VPN connection is established and errors because it can't find the network share. Here's the script:
' VBScript.
Dim net
Set net = CreateObject("WScript.Network")
net.MapNetworkDrive "Z:", "\\server\test","True"

How do I add a 5 second pause to allow the netowrk to fully connect before attempting to map the drive?

Thanks
 
Hello sageturkey,

It is .sleep, param in the unit of ms.
Code:
wscript.sleep 5000
regards - tsuji
 
Thanks for the tip, tsuji! I found a much more entailed Timer method that does the job but I like this one better. Will this work with Win98 machines?

Karl

 
This method is platform independent. You need however a Scripting runtime decently recent for this to work. The simplest way to get the last scripting engine is to update your internet explorer to IE 6.0 SP1.

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top