Solved

Execute command within form and shell

Posted on 2008-06-18
4
2,183 Views
Last Modified: 2013-11-26
Hello,

This might be hard to explain since I am new with VB.NET, but here is a try. I want to create an app that will excute DOS commands. Rather than have the dos commands excute outside of the app, I would like to create a form that has a DOS window placed into it. Then, when I collect the information I want via the form fields, I will use that information to run the dos command. Is this easy to do, and if so, can you give me a small and easy example or direct me towards information to teach me how to do this?

Thanks,
John

0
Comment
Question by:jhieb
  • 2
4 Comments
 
LVL 16

Expert Comment

by:ororiole
ID: 21818444
If you dont actually need to open a dos window inside the form, this link will give you examples on how to execute dos commands inside your windows app. Its actually in C# but most of it is just using the System.Diagnostics.Process class so you will be able to follow it ok.
0
 
LVL 1

Author Comment

by:jhieb
ID: 21862378
I would like to open a dos window in the form, but I am also interested in your link. Please post it.
0
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
ID: 21862531
It is one thing to execute DOS commands from within your programme or to create something that looks like a DOS window (scrolling textbox with black background and white text in monospace letters), it is a completely different thing to actually operate a DOS box within your programme, which means you have to capture the output of a DOS command and display it in the imitated DOS textbox inside your application, plus you will have to pass commands typed into this textbox over to DOS.
For all this, you will have to create what programmers call a "pipe"; a "read-pipe" to capture, a "write-pipe" to pass through your commands.

Although I never tried to do this in VB (did it in Delphi once many years ago), I should say that it is definitely not easy stuff for beginners.

In case this doesn't put you off, here's the point where you can start:
http://www.devx.com/dotnet/Article/7914/1954
(check section: Controlling Process I/O)
0
 
LVL 1

Author Closing Comment

by:jhieb
ID: 31468632
Thanks for the advice and the link
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML - Color not displaying correctly in EMAIL. 6 49
Iteration Help (Asp.net VB) 5 24
Vb.net threads keep increasing 2 35
transition to visual .net from vb6 5 37
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

839 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