shawnlehner
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
ASKER
forgot the quotes around it but they are there in my program
Are you looking for Application.StartupPath?
Bob
Bob
ASKER
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.
I have one program... c:\test\test.exe that is using shell("c:\myapp\myapp.exe"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
procMain.StartInfo.Working Directory = "c:\myapp\"
procMain.Start("c:\myapp\m yapp.exe")
it still will not work.
procMain.Start("c:\myapp\m
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
Bob
ASKER
still looks in the current applications folder for its required files
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
C#.net
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
because it is the application I need to launch....
ASKER