Software Development Network>> VS Team System>> launching an exe from application menu
Use the System::Diagnostics::Process class: http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.aspx.
A quick example:
System::Diagnostics::Process::Start("notepad.exe");
That works great. Now I need to do 2 more things.
1) I need to specifiy the file path EX: C:\\myfolder\myapp.exe
2) I need to use the directory that my application is in, automatically detect the directory, and run a program in a subdirectory.
EX: current_directory+"subfolder\myapp.exe"
If I understand correctly this is what you need:
Process::Start(Path::Combine(Application::StartupPath,
Application::StartupPath gets the folder where your executable is, Path::Combine combines this path with the subfolder/exe file that you want to start.
launching an exe from application menu
Jehan Badshah
Use the System::Diagnostics::Process class: http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.aspx.
A quick example:
System::Diagnostics::Process::Start("notepad.exe");
aclauson
That works great. Now I need to do 2 more things.
1) I need to specifiy the file path EX: C:\\myfolder\myapp.exe
2) I need to use the directory that my application is in, automatically detect the directory, and run a program in a subdirectory.
EX: current_directory+"subfolder\myapp.exe"
davidw
If I understand correctly this is what you need:
Process::Start(Path::Combine(Application::StartupPath,
"subfolder\\myapp.exe"));Application::StartupPath gets the folder where your executable is, Path::Combine combines this path with the subfolder/exe file that you want to start.