Link to home
Start Free TrialLog in
Avatar of shawnlehner
shawnlehnerFlag for United States of America

asked on

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?
SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shawnlehner

ASKER

shell from vb.net
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.
forgot the quotes around it but they are there in my program
Are you looking for Application.StartupPath?

Bob
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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
procMain.StartInfo.WorkingDirectory = "c:\myapp\"
procMain.Start("c:\myapp\myapp.exe")

it still will not work.
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
still looks in the current applications folder for its required files
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
C#.net
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
because it is the application I need to launch....