Jump to content
  • Advertisement
Sign in to follow this  
Cozmoz

[.net] How to run an EXE from a C# project

This topic is 4032 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, I have built an EXE assembly and now I have created a new project from where I want to run it. Is there any way I can run the already built EXE by adding it as a reference in my current project which will in turn find its entry point and execute it as a separate process? I've already made it work using this code:
System.Diagnostics.Process process2 = new System.Diagnostics.Process();
process2 = System.Diagnostics.Process.Start(@"C:\...");

but I don't really like it as it's using an absolute path to the exe, that's why I want to add the EXE as a reference. Thank you very much

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Cozmoz
but I don't really like it as it's using an absolute path to the exe

Application.StartupPath + "exename.exe"?


However, out of curiosity, why did you structure it like that? (two exes, one calling the other.)

Share this post


Link to post
Share on other sites
Hey, that did it :), well the reason behind the two EXEs is that I developed them separately and they can work as stand-alone applications, now I decided I could combine them into a bigger application but I don't feel up to reworking the EXE that gets called.


thanks for the quick reply

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!