By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,872 Members | 2,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,872 IT Pros & Developers. It's quick & easy.

Retrieve Command Line arguments

P: n/a
Is there a way to get the Command Line Arguments of a running process?

myProcess.StartInfo.Arguments is empty and doesn't work.
I am looking to find the Arguments for any process that is already
running including ones that I did not personally start.

Here is what I can get so far...

Process[] runningProcesses = Process.GetProcesses();
foreach(Process process in runningProcesses)
{
Console.WriteLine(process.StartTime.ToLongTimeStri ng());
Console.WriteLine(process.ProcessName);
Console.WriteLine(process.MainModule.FileName);
Console.WriteLine(process.MainWindowTitle);
Console.WriteLine(process.MainModule.FileVersionIn fo.FileVersion);
}
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.