First we declares a ReadOnlyCollection to store the value from our commandline.
Dim CommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs
The to get them one by one it's just to refer to its index, in the example below a messagebox will pop up with the arguments one by one.
For i As Integer = 0 To CommandLineArgs.Count - 1 MessageBox.Show(CommandLineArgs(i)) Next
This was actually all the code but before publishing you need to remember to uncheck the "use .deploy file extension" checkbox:
Now after publishing you will get the .exe file. If you create a shortcut to this .exe file you can add command line arguments to it as shown in the image below:
Our program can now read these argument and one messagebox showing "Argument1" will be shown and then one showing "Argument2".
That was it. Hope you liked it