Solved

Visual Basic 2010 Shell command to change foler and run command in the folder

Posted on 2010-11-27
4
1,187 Views
Last Modified: 2013-11-26
Hi
I am writting a small program in Visual Basic studio 2010, I would like to shell to a command prompt change the working directory then run a command still within the working directory, can anyone tell me how this can be achieved
0
Comment
Question by:sykotex
[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 96

Expert Comment

by:Bob Learned
ID: 34222050
Are you talking about a Console application, that can interact with the Console?  Or, are you talking about using System.Diagnostics.Process?
0
 
LVL 1

Author Comment

by:sykotex
ID: 34222069
I'm a begginer so I may not be to clear. I have a program which runs from a command line. I am writting a windows form front end that will ulimatley run this program with its switches at the end. The switches for the command line program use file paths which don't appear to work if a full path is entered
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 34222625
If you have a Windows Forms application, and you need to start an external process, you can use the System.Diagnostics.Process class, like in this example:

Process Class (System.Diagnostics)

Dim myProcess As New Process()

            Try                ' Get the path that stores user documents.

                myProcess.StartInfo.UseShellExecute = False
                ' You can start any process, HelloWorld is a do-nothing example.
                myProcess.StartInfo.FileName = "C:\\HelloWorld.exe"
                myProcess.StartInfo.CreateNoWindow = True
                myProcess.Start()
                ' This code assumes the process you are starting will terminate itself. 
                ' Given that is is started without a window so you cannot terminate it 
                ' on the desktop, it must terminate itself or you can do it programmatically
                ' from this application using the Kill method.

Open in new window

0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 34222914
please go through the following link, it clearly tells how to add console in a windows form:-

http://stackoverflow.com/questions/252323/how-do-i-add-a-console-like-element-to-a-c-winforms-program
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

734 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