0

I've found this a little hard to find, so I decided to share with you guys.

This small code will allow your app to accept arguments.

Just copy the whole code into the main sub (I didn't tested elsewhere) and edit the code inside the for to do what you want. Voila! It works.

Hope it helps!

Edited by RenanLazarotto: n/a

Dim CommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs

For i As Integer = 0 To CommandLineArgs.Count - 1
'the message box is just a example. you can make Ifs to check the arguments and do the desired options
MessageBox.Show(CommandLineArgs(i))
Next
3
Contributors
2
Replies
11
Views
6 Years
Discussion Span
Last Post by anoopkh
0

The command line argument can be shown in a messagebox like the following

msgbox(command())

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.