Using shell to run program

I am using shell to run a program but when I execute the program it looks it the local root of the program calling it for its required files instead of its root, is there a way to get around this?
LVL 4
shawnlehnerAsked:
Who is Participating?
 
jrschererCEOCommented:
Hi shawnlehner,
Use the "Process" control from the toolbox "Components". It allows you to set all the environment for your application to run, including Startinfo.Workingdirectory.
This may help.
Jack.net
0
 
Bob LearnedCommented:
Shell from ASP.NET?

Bob
0
 
shawnlehnerAuthor Commented:
shell from vb.net
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
shawnlehnerAuthor Commented:
just like this shell(c:\myapp\myapp.exe) instead of looking in c:\myapp for its required files it looks it the local directory of the program executing it.
0
 
shawnlehnerAuthor Commented:
forgot the quotes around it but they are there in my program
0
 
Bob LearnedCommented:
Are you looking for Application.StartupPath?

Bob
0
 
shawnlehnerAuthor Commented:
ok here is the exact situation...

I have one program... c:\test\test.exe that is using shell("c:\myapp\myapp.exe") to run myapp.exe but when myapp.exe runs it is looking for all of its required files in c:\test\ instead of c:\myapp\ like it would if you double clicked and ran it.  I need a way to tell it to read it from tis root, not the root of the application that is calling it.
0
 
shawnlehnerAuthor Commented:
procMain.StartInfo.WorkingDirectory = "c:\myapp\"
procMain.Start("c:\myapp\myapp.exe")

it still will not work.
0
 
Bob LearnedCommented:
I am curious why that didn't work.  I would have thought it was a good solution.  What happens when it doesn't work?  Errors?  Incorrect results?

Bob
0
 
shawnlehnerAuthor Commented:
still looks in the current applications folder for its required files
0
 
jrschererCEOCommented:
how is the access to the local files done in MyApp.exe? How do you define the local path? The problem may be within MyApp.exe
Jack.net
0
 
Bob LearnedCommented:
Is the application that you are running a .NET assembly, or something else?

Bob
0
 
shawnlehnerAuthor Commented:
C#.net
0
 
Bob LearnedCommented:
Why are you trying to shell to a C# application?

Bob
0
 
shawnlehnerAuthor Commented:
because it is the application I need to launch....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.