Solved

How do I reflect output from dos command?

Posted on 2004-09-10
7
199 Views
Last Modified: 2012-05-05
Hi, I am new to VB & .net.

I need to create a simple application that will allow me to have a button pushed that reflects dos command and then the output reflected in a return box.  I also need to be able to add variables to the button(s) instructions.

if you need more info, please let me know.
0
Comment
Question by:ganongj
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:imu79
ID: 12028075
Could you clarify a bit please..

Imran.
0
 
LVL 4

Author Comment

by:ganongj
ID: 12028428
Here's an example:

a gui interface to traceroute.
a button on the vb interface that runs traceroute, some text box for variables to use when button pushed (the i.p. address to be tracerouted)
a box that reflects the results and stays there until closed.
0
 
LVL 3

Expert Comment

by:imu79
ID: 12029024
So basically you want to redirect the ouput from the console (command) window to some textbox.

here's an example that should work:

http://dotnet.mvps.org/dotnet/samples/miscsamples/downloads/RedirectConsole.zip

Note that in the sample. a new thread is created to read the output since the output is being dynamically generated. If you just tried to read the output, you could run into problems.

hope that helps..
Imran.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 4

Author Comment

by:ganongj
ID: 12030230
Ha ha, very funny, the example is in German!
0
 
LVL 3

Accepted Solution

by:
imu79 earned 500 total points
ID: 12030391
well..that wasn't meant to be a joke. yes, the comments are in a different language (i'm not sure which one..) but the code is still in english, right? I mean you should be able to get an idea from that.

anyway, Here's another version of the same thing (slightly different):

http://tinyurl.com/4jwys

Everything is the same as the previous sample except the reading of the output. You should start the reading of the output in another thread since the output is being generated dynamically and it would freeze your application till the read is complete. Just use the code to start the process from the link above and use the threading technique that's in the sample that I sent you earlier. It should be easy to read. Let me know if you have any problems.

hope that helps..
Imran.
0
 
LVL 4

Author Comment

by:ganongj
ID: 12102434
This really hasn't answered my question so I am leaving it open.

Jim
0
 
LVL 4

Author Comment

by:ganongj
ID: 12189504
I give up.  No answer given. apparently no  one knows.

Jim
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now