0

Possible Duplicate:
Embedding an external executable inside a C# program

I create project "MyProj" and add to resource program "This.exe"...

How could I start "this.exe" in "MyProj.exe"?

Thanks for any ideas.

Community
  • 1
  • 1
Azure
  • 113
  • 2
  • 2
  • 7
  • If you mean start the right executable http://stackoverflow.com/questions/11951694/compiling-c-in-visual-studio-2010-not-creating-exe-file/11951832#11951832 – user1655481 Sep 15 '12 at 09:40

2 Answers2

3

Once you added the .exe to your project, got to the properties window then change the Build action to Content and Copy to output directory to Always Copy or Copy if newer

enter image description here

To run the Application use :

Process.Start("This.exe");
Nasreddine
  • 36,610
  • 17
  • 75
  • 94
  • @Azure You're welcome :). [Here's an article](http://tinyurl.com/so-hints) on how to better ask questions to avoid getting down voted and remember to always accept the answers that solve your problems. – Nasreddine Sep 15 '12 at 09:57
  • okey, I will read article about ask questions :). And there is any way to contain "this.exe" into project? becouse your way is copy "this.exe" to destination where is "starting" program (MyProj.exe create this.exe and start it and I need hide this.exe before user), I hope that you understand me :). – Azure Sep 15 '12 at 10:07
  • @Azure If I understand you correctly, you could embed the .Exe file as a resource. – Nasreddine Sep 15 '12 at 10:30
  • yes :), and I [find how start app from resource...](http://stackoverflow.com/questions/798655/embedding-an-external-executable-inside-a-c-sharp-program) thx for your time ;) – Azure Sep 15 '12 at 11:40
1

Press F5 or go to Debug -> Start Debugging (this is the same as hitting the Play button).

If you don't want debugging then press Ctrl + F5 or go to Debug -> Start without debugging.

EDIT: After the author's edit I think this is the answer: Launching an application (.EXE) from C#?

Or maybe: Run exe file added as resource in visual studio

Community
  • 1
  • 1
Paul
  • 20,883
  • 7
  • 57
  • 74
  • I'm not such a beginner... I closer this probelm, I create project "MyProj" and add to resource program "This.exe"... how I start "this.exe" in "MyProj.exe"? – Azure Sep 15 '12 at 09:38
  • Well you definitely stated your problem wrong, see: http://stackoverflow.com/questions/240171/launching-a-application-exe-from-c – Paul Sep 15 '12 at 09:39
  • yep I apologize, I do not speak English very well... – Azure Sep 15 '12 at 09:43