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

Pathping and tracert?

Status
Not open for further replies.

Smithsco

Technical User
Mar 30, 2003
89
AU
I would like to run pathping and tracert style commands, and grab specific parts of the date out, does anyone know how to obtain this type of info using a script?
 
Here's a piece of code that outputs a tracert command to a file and then reads the contents.

Regards,

mapman04

===================

Dim oShell,txt1,fso,ln1,str1
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "cmd /C CD C:\ & TraceRT 10.10.3.230>C:\Temp\TraceRT.txt",0,true
Set fso = CreateObject("Scripting.FileSystemObject")
Set txt1 = fso_OpenTextFile("C:\Temp\TraceRT.txt",1)

Do While txt1.AtEndOfStream = False

ln1 = txt1.Readline

str1 = Mid(ln1,9,1)

If str1 = "*" Then
MsgBox "IP Address is not valid!",64,"TraceRoute"
Exit Do
End If

Loop

Wscript.Quit
 
Yeah you could also ues ping 192.xxx.xxx.xxx > filename.txt to write it to a file, but I was only after specific information so I can write them to a log file :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top