View Single Post
Old 03-12-2019, 09:59 AM
berdmann berdmann is offline
VanDyke Technical Support
Join Date: Aug 2017
Posts: 441
Hi GuitarDude,

You can run a script in SecureCRT to get the IP address using crt.Session.RemoteAddress and then launch CMD to do the ping.

Here is a general example:

strTarget = crt.Session.RemoteAddress

Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("ping -n 2 -w 1000 " & strTarget)
strPingResults = LCase(objExec.StdOut.ReadAll)
myResponse = msgbox("Ping Results: " & vbcr & vblf & strPingResults)
As you can see, the only thing that is really specific to SecureCRT's scripting API is crt.Session.RemoteAddress. The rest of what you would like to do falls outside of SecureCRT.

We were not able to find a way to get CMD to display the ping results real time.

VanDyke Software
Technical Support
(505) 332-5730