Tag Archives: command line

Get the command line

There are two ways to get the command line.

string commandLine = System.Environment.CommandLine;

This property contains the entire (full) command line.

or use:

string[] commandLine = System.Environment.GetCommandLineArgs();

The first array element contains the executable (may include the path)
The other array elements the arguments. They are separated by spaces.

Lastest update in May 2011, inital post in May 2011