I have figured it out...
First under the command line arguments I added the commands, within the solution properties.
Then in Application.Designer.vb (Program.cs Main() if you're using c#) Under
Protected Overrides Sub OnCreateMainForm()
I added the following...
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Try
If Me.CommandLineArgs(0) = "/a" Then
test.openForm1()
ElseIf Me.CommandLineArgs(0) = "/b" Then
test.openForm2()
ElseIf Me.CommandLineArgs(0) = "/c" Then
test.openForm3()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
test is the name of the exe i'm compiling.
this in the batch file, this works...
c:\TestFolder\TestApp\test.exe /a
c:\TestFolder\TestApp\test.exe /b
c:\TestFolder\TestApp\test.exe /c
PLEASE NOTE:
You MUST remember to specify AT LEAST ONE command line argument in your project properties, it can be any value, just not empty.
Click on DEBUG in the project properties > go to the Start Options > Command Line Arguments: "/anything"
If you miss this out, you may get a System.Argument.OutOfRangeException / Index was out of range.