Private Sub ParseCommandLineArgs()
Dim inputArgument As String = "/input="
Dim inputName As String = ""
For Each s As String In My.Application.CommandLineArgs
If s.ToLower.StartsWith(inputArgument) Then
inputName = s.Remove(0, inputArgument.Length)
End If
Next
If inputName = "" Then
MsgBox("No input name")
Else
MsgBox("Input name: " & inputName)
End If
End Sub
but it appears to be part of ConsoleApplicationBase not sure if it can only be called as part of a console or if it will work with a GUI program.
Start your application with a Sub Main from a module, and define Sub Main like this:
Code:
Module Module1
Public Sub Main(args() As String)
For Each arg As String In args
'Do something
Next
End Sub
End Module
The args() array is a String array containing all arguments passed while running the application. Doing it this way, you can even choose to run different forms at startup, depending on commandline arguments.
Regards, Ruffnekk
---
Is it true that cannibals don't eat clowns because they taste funny?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.