noob question help launching ping wsh / vbs

syborfical

Member
Nov 23, 2005
29
0
0
For work I need to test network connections.
To do this I usally launch 8 or more pings @ 1400 bits.
Or ping ?l 1400 ?t, sometimes ?f

I can get VBS scripts to lunch multiply pings. Fine by using

Dim oShell

Set oShell = WScript.CreateObject ("WSCript.shell")

oShell.run "cmd /k ping 192.168.0.1 -l 1400 -t"

Set oShell = Nothing

Is it possible to some how add a box that ask me for the ip address?

So I could substitute the ip address with X or something like that
So every time I run the script it asks for the ip then lunches 8 or more pings to that ip?
 

SearchMaster

Diamond Member
Jun 6, 2002
7,791
114
106
There is a command called InputBox that will prompt for input, or you could have it take a command line parameter. I'm too lazy to link but just google for "vbscript inputbox" and you should find what you need.
 

Noobsa44

Member
Jun 7, 2005
65
0
0
You want to enter something like this:

IP = InputBox("Enter an IP.")

if(IP<>"")'check if cancel pressed
oShell.run "cmd /k ping " & IP & " -l 1400 -t"
end if