I'm trying to run the following script to find out which addresses are being used on our local network.
If I cscript it, whenever it encounters a "run", it pops up a new window so I get about 254 windows opening at a rate of knots. What I'd like to happen is for all the results to appear in the cmd window from which it is launched so I can format and pipe the result to a file.
The question is how can I get a .exe to execute in the same window and print its results in that widow
Code:
dim objShell
set objShell = CreateObject ("WScript.Shell")
for i=1 to 254
str = "ping -n1 -w10 192.168.0." & cstr(i)
WScript.echo str
objShell.Run str
next
The question is how can I get a .exe to execute in the same window and print its results in that widow