Can I get command line arguments of other processes from .NET/C#?
- by Jonathan Schuster
I have a project where I have multiple instances of an app running, each of which was started with different command line arguments. I'd like to have a way to click a button from one of those instances which then shuts down all of the instances and starts them back up again with the same command line arguments.
I can get the processes themselves easily enough through Process.GetProcessesByName(), but whenever I do, the StartInfo.Arguments property is always an empty string. It looks like maybe that property is only valid before starting a process.
This question had some suggestions, but they're all in native code, and I'd like to do this directly from .NET. Any suggestions?