Solved

Execute command within form and shell

Posted on 2008-06-18
4
2,192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

628 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