Solved

Execute command within form and shell

Posted on 2008-06-18
4
2,178 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
asp.net mvc5 3 35
Paging GridView 7 32
Library to convert HTML to PDF. 8 44
index Out OF Range Exception error 4 27
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

707 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

17 Experts available now in Live!

Get 1:1 Help Now