Command-line arguments is part of Short Circuit's Console Program Basics selection.
Scripted main
See also Program name.

For parsing command line arguments intelligently, see Parsing command-line arguments.

Example command line:

myprogram -c "alpha beta" -h "gamma"

Loop %0% ; number of parameters
  params .= %A_Index% . A_Space
If params !=
  MsgBox, %0% parameters were passed:`n`n %params%
Else
  Run, %A_AhkPath% "%A_ScriptFullPath%" -c "\"alpha beta\"" -h "\"gamma\""