View Single Post
Old 03-12-2019, 11:07 AM
GuitarDude GuitarDude is offline
Registered User
Join Date: Mar 2019
Posts: 8
Originally Posted by berdmann View Post
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.
This does the trick just right. It would be nice to have the real time but as long as I see something, I'm okay with it. I really do like the message though. Gives all the information that I need