Reading Command line arguments in VB.NET
07-Sep-1111 Leave a comment
Nice clear entry at:
In Project > My Project > Publish > Options > Deployment
Uncheck “Use “.deploy” file extension
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:
Dim CommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs
For i As Integer = 0 To CommandLineArgs.Count - 1 MessageBox.Show(CommandLineArgs(i)) Next
There maybe reasons why you may not want to uncheck this. Namely: