|
-
Nov 28th, 2009, 10:05 AM
#1
Thread Starter
New Member
Starting a program with a chosen path
Last edited by cuvvvie; Nov 26th, 2010 at 08:56 PM.
-
Nov 28th, 2009, 08:14 PM
#2
Re: Starting a program with a chosen path
There's no need to set your app's CurrentDirectory.
vb.net Code:
Dim psi As New ProcessStartInfo(fileName) psi.WorkingDirectory = folderPath Process.Start(psi)
vb.net Code:
Dim psi As New ProcessStartInfo(IO.Path.Combine(folderPath, fileName)) psi.UseShellExecute = False psi.WorkingDirectory = folderPath Process.Start(psi)
One of those will do what you want, depending on what you're trying to achieve and how the app being started behaves. You just have to pass the correct folder path and file name.
-
Nov 28th, 2009, 08:22 PM
#3
Thread Starter
New Member
Re: Starting a program with a chosen path
Last edited by cuvvvie; Nov 26th, 2010 at 08:56 PM.
-
Nov 28th, 2009, 08:27 PM
#4
Re: Starting a program with a chosen path
 Originally Posted by cuvvvie
Yes there is
No there isn't. That's what I have set the WorkingDirectory in my code examples for. It specifies the startup folder and/or current directory for the new process without your having to change the current directory for the current process.
-
Nov 28th, 2009, 08:29 PM
#5
Thread Starter
New Member
Re: Starting a program with a chosen path
Last edited by cuvvvie; Nov 26th, 2010 at 08:56 PM.
-
Nov 28th, 2009, 08:30 PM
#6
Re: Starting a program with a chosen path
 Originally Posted by cuvvvie
Oh, I thought you meant my original code  , I understand that there is no need for it in the code you gave me.
I meant exactly what I thought I meant. You must improve your mind-reading skills.
-
Nov 28th, 2009, 08:32 PM
#7
Thread Starter
New Member
Re: Starting a program with a chosen path
Last edited by cuvvvie; Nov 26th, 2010 at 08:56 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|