-1

So for example, I have a few apps that I want the user to be able to use within one central app, so that means I need to run the app and give it the data it needs, so that it can return things to the central app.

How could I go about running the seperate apps from one c# app, and how would I be able to run it as long as they are in the same folder, no matter where that folder is.

Thanks in advance

PS: I know i could just code in the functions of the apps into one app, but what if I needed to connect my c# app with a python or java app?

  • 2
    Using [Process.Start Method](https://learn.microsoft.com/dotnet/api/system.diagnostics.process.start) you can run an application and get its [Process](https://learn.microsoft.com/dotnet/api/system.diagnostics.process) object, so you can monitor, control and also for example wait for its exiting in a thread to get the result termination code. –  Jan 22 '21 at 05:40
  • If you want communication between process, this is [another question](https://stackoverflow.com/questions/65220025/how-to-update-a-winforms-control-of-a-running-application-when-another-instance/65220487#65220487) (more links [here](https://stackoverflow.com/questions/63560777/c-sharp-singleton-class-working-well-confirmation/63965520#63965520)) –  Jan 22 '21 at 05:40

1 Answers1

1

Reputation is not high enough to comment, so here are my 2 cents.

This code gives you your main-exe-location, from there append your other executables names and use process.start or the other solutions as suggested.

using System.IO;
using System.Reflection;

string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string path = Path.Combine(directory, "your.exe");