Solved

How do I reflect output from dos command?

Posted on 2004-09-10
7
200 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tabcontrol Caption? 1 30
Set form below another form 3 35
Help with sorting data in Listbox using VB.NET 3 53
VB.net/WinForms: adjust Screen Resolution 6 41
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

11 Experts available now in Live!

Get 1:1 Help Now