DavidOverton.com
This site is my way to share my views and general business and IT information with you about Microsoft, IT solutions for ISVs, technologists and businesses, large and small.  

June 2007 - The Random Musings of an IT Consultant.......

  • Ping a remote host then if it times out run a TRACERT and send an email

    Recently I needed to find out why a connection to a server was failing every so often. I knocked this script up from a few pieces of old wood and a couple of tin cans I had lying around to do just that. It was nicely indented until I pasted it into here :-) Run it using the following command line: cscript <filename.vbs> Setup a scheduled task to run it when you need to. ' Created by Ian Watkins - Oxbridge Technology Ltd - May 2007 On Error Resume Next Set WshShell = WScript.CreateObject("WScript.Shell") strComputer = "host.domain.com" vbCRLF = Chr(13) & Chr(10) strPingStatus = PingStatus(strComputer) If strPingStatus = "Success" Then Wscript.Echo "Success pinging " & strComputer Else WshShell.Run "%comspec% /c c:\windows\system32\tracert.exe " & strComputer & " > c:\belfry\testlog.txt" , ,1 Const ForReading = 1, ForWriting = 2, ForAppending = 8 Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") 'Open...

(c)David Overton 2006-23