Can I get command line arguments of other processes from .NET/C#?

Posted by Jonathan Schuster on Stack Overflow See other posts from Stack Overflow or by Jonathan Schuster
Published on 2010-04-13T22:24:38Z Indexed on 2010/04/13 23:43 UTC
Read the original article Hit count: 653

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#