Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

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?
0
shawnlehner
Asked:
shawnlehner
  • 8
  • 5
  • 2
5 Solutions
 
Bob LearnedCommented:
Shell from ASP.NET?

Bob
0
 
shawnlehnerAuthor Commented:
shell from vb.net
0
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
jrschererCommented:
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
 
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
 
jrschererCommented:
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 8
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now