View Full Version : Adding results of Dos commands to a file
G Mills
10-14-2004, 10:41 AM
Does anyone know how you may be able to store the results of a ping command in a text file?
I have been able to run the ping using the followin code:
Gateway = Dialog.Input("Enter Default Gateway", "What is the Address of your default gateway:", "", MB_ICONQUESTION);
Shell.Execute("ping", "open", Gateway, "", SW_SHOWNORMAL);
My problem is being able to add the ping results to a text file. Any clues?
Jason Pate
10-14-2004, 10:55 AM
Ping 192.168.1.15>ping.txt you can also specify the path to the ping.txt file. The > will redirect the out put for you, this is an OLD dos method but works in XP.
ping x.x.x.x>text file name
Shell.Execute("ping", "open", Gateway..">ping.txt", "", SW_SHOWNORMAL);
I did not run it but that should work.
djpyne
03-20-2006, 10:07 AM
I actual was able to make this work with this:
Shell.Execute("CMD", "open", "/C Ping "..Gateway..">ping.txt", "", SW_SHOWNORMAL);
This is very interesting to know. Thanks
Adam Kapilik
To append to the file, use >>
No kidding! I swear some of these tips are worth tatooing on my arm!
_ _
I / V \ \ \
I | | \ \
I \ / / /
I \ / / /
The ASCII is strong in this one..
Here's a post on Pinging from AMS too. I wrote a DLL that does it, and Corey took aother angle
http://www.indigorose.com/forums/showthread.php?t=6216&highlight=ping+dll
Intrigued
03-22-2006, 05:27 PM
How can you all talk about Ping when Pong has so much potential as well?!
(snort laught)
:p
...I almost named my dog traceroute... :rolleyes
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.