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
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