Link to home
Start Free TrialLog in
Avatar of chlade
chlade

asked on

Populating Command Line Arguments

I have an application that can accept any number of command line arguments (using the Command() function).

Currently to test different scenarios, I have to constantly go into the Properties page and change the Command Line Arguments on the Debug tab.

I want to write a tester application that will open this form and I'd like to "populate" the command line arguments from vb.net.  Is this possible?

Note that I am not using the SHELL command or anything like that.  I am simply instantiating a form that uses the Command() function.
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlexFM
AlexFM

You can use Process.Start Method (String, String) in the testing application. It should contain Windows form with textbox and Start button. Textbox contains command line arguments filled by user. When Start button is clicked, execute the following code:

Process.Start Method ("tested-application-name.exe", textBox1.Text)

Other way is using Windows Run command, or batch file.