[RESOLVED] passing parameters to exe
How would one go about sending parameters to the application?
For example, I want to send my exe some switches or parameters.
my_app.exe -param1 -param2
Something like that. Then I can use the para1 and param2 throughout the exe
Possible?
But it is not command line, it is gui based
Re: passing parameters to exe
You could use a Windows shortcut with params and then examine them as follows.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Application.CommandLineArgs.Count > 0 Then
For Each cmd In My.Application.CommandLineArgs
Console.WriteLine("{0}", cmd)
Next
End If
End Sub
Re: passing parameters to exe
very cool, thank you Kevin.
Worked like a charm.