79571663

Date: 2025-04-13 14:40:54
Score: 0.5
Natty:
Report link

Your first example will exit immediately because you don't call any of the WaitForExit functions. Process.Start starts a process but doesn't stick around until it ends.

Your second example is a little more nuanced. There are 2 probable scenarios

In most (all?) cases you can find the actual game executable and launch it directly (for example, I can find many of my steam games in C:\Program Files (x86)\Steam\steamapps\common\<Name of Game>. If you find the appropriate .exe file and launch it directly you can probably achieve what you want.

Note that if Steam launches the app with command line arguments you may need to replicate those in your program. You can discover the arguments in the Details pane of the Task Manager if you enable the "Command Line" column

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Jeremy Richards