View Full Version : Response Output from a DOS Command
KrazyKid
03-18-2003, 01:52 PM
I have a easy question...so I think...I couldn't find any methods here because the search feature will not accept "cmd" or "DOS" as valid criteria (too short!)
I would like to acheive displaying the results of a cmd similar to this:
dir >> file.txt
Only instead of the output being piped to a file; the output is displayed through a Response.Write to a dynamic page
What is the easiest way to accomplish DOS Command Output To The Browser without creating a file?!?!
Thanks in advance!
i'm not sure i completely understood all that, but i think you want to print the content of a directory to the browser ?
Well, then just use the FSO and it's a piece of cake.
There's a sticky about it on top of this forum.
Here's the link
http://www.codingforums.com/showthread.php?s=&threadid=8736
Was this what you're looking for.
KrazyKid
03-18-2003, 08:21 PM
Thanks....but....
I was afraid that my example would cause confusion, the sticky post addresses the "dir" operation but not specifically the command.
Lets say I wanted to do a tracert or a ping and have the output echo to a stream that is processed by the ASP.
I would think that this is able to be done relatively easy; however I can't seem to get the right method.
Thanks in advance!
hmm. i see.
it's not custom to run a doscommand and then print the output to a browser. i'd try first if it can't be done with asp. (and it can be done in asp)
about pinging a server:
this is a good and comprehensive tutorial. It does axactly what you ask for (+ some extra's) be he uses a MS Server with a stored procedure. But it shows it can be done.
http://www.devarticles.com/art/1/12
And here's a free asp-component (asp ping) that does exactly that. Just 5 lines a code.
http://home.tvd.be/ws36178/webmaster2020/asp/components.html#aspping
Old Pedant
05-12-2009, 08:41 AM
ANOTHER INAPPROPRIATE RESPONSE.
This is an ASP forum.
Java code is irrelevant to ASP, in general. And to this topic in particular.
** PLEASE POST responses that are RELEVANT to the forum. Java answers in Java and JSP forums. **
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.