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

Logon Script issue

Status
Not open for further replies.

davy2k

Technical User
Mar 18, 2007
69
JP
Hi All,
I wrote and tested a script which tests the availability of an intranet server before opening a link in internet explorer, If ping is successful open page if not do nothing.

When disconnected from the network nothing happens as well.

here is a copy of the script:

On Error Resume Next

Dim strTarget, strPingResults

strTarget = "10.200.25.217" 'IP address or hostname

strMsg = strTarget & " is Unavailable."


ApptoRun = "iexplore.exe
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshExec = WshShell.Exec("ping -n 3 -w 1000 " & strTarget) 'send 3 echo requests, waiting 2secs each
strPingResults = LCase(WshExec.StdOut.ReadAll)

If InStr(strPingResults, "reply from") Then
WshShell.Run ApptoRun
Else

End If

it works fine when I tested it on my single domain controller network.

but when I sent the same script to my client (whose AD network I have no control over) to implement the script works fine when they login to the domain but when the user disconnects from the network the webpage still launches and displays "Page cannot be found" this is not supposed to happen since the script is not supposed to run when the PC is not on the network.

My only explanation was that its probably due to a cache on the local machine.

Please any link or suggestions is very much appreciated
 
You should ask this in the vb script forum. BTW before you post it there remove "On error resume next" to see what errors you getting. And at no point can I see that if there is no reply then wscript.quit which is why it will run if the server is unavailable.

MCITP:EA/SA, MCSE, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top