Passing arguements to a windows program

jspeirer

Member
Joined
Aug 7, 2003
Messages
8
I need to start up a windows program from a console program and I need to be able to pass in some arguements. These arguements will put the windows program into an initial state. Im sure there is an easy way to do this, Im just too new at this.
 
If you want to start a program then you can do it by using the System.Diagnotics.Process class, and its Start() method.
To pass in aguments to that program right after the exe path type them in, when using the Process start method.
To retrieve those you can use the following System.Environment.CommandLine and System.Environment.GetCommandLineArgs, which return the whole command line or command line divided into a string array, respectively.
 
Last edited by a moderator:
Back
Top