Command, Command$ (functions)

Syntax

Command[$][()]

Description

Returns the argument from the command line used to start the application.

Comments

Command$ returns a string, whereas Command returns a String variant.

Example

This example checks to see if any command line parameters were used. If parameters were used they are displayed and a check is made to see if the user used the "/s" switch.

Sub Main()

  cmd$ = Command

  If cmd$ <> "" Then

    If (InStr(cmd$,"/s")) <> 0 Then
      MsgBox "Safety Mode On!"
    Else
      MsgBox "Safety Mode Off!"
    End If

    MsgBox "The command line startup options were: " & cmd$

  Else
    MsgBox "No command line startup options were used!"
  End If
End Sub

See Also

Environ, Environ$ (functions).

More information

C