LocationMy.Application.CommandLineArgs SyntaxDim result As System.Collections.ObjectModel.ReadOnlyCollection( _ Of String) = My.Application.CommandLineArgs DescriptionThe CommandLineArgs property returns a collection of each space-delimited argument from the command-line text used to initiate the application. This collection includes the arguments only; the application path used to start the application is not included. The System.Environment.CommandLine property, on the other hand, includes the application path. Usage at a Glance
ExampleThe following example looks for the argument "/?" and takes action when found. Private Sub CheckCommandOptions( ) Dim scanArg As String For Each scanArg In My.Application.CommandLineArgs If (scanArg = "/?") Then ' ----- Show application usage. MsgBox("syntax: PrintInColor.exe [filename]") End End If Next scanArg End Sub Related Framework Entries
See AlsoApplication Object, GetEnvironmentVariable Method |