If $CmdLine[0] = 0 Then
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptFullPath & '" -File "C:\test.txt" -Line "Some_Line"')
Exit
EndIf
_OnCmdLineFunc("File", "_Cmd_Get")
_OnCmdLineFunc("Line", "_Cmd_Get")
Func _Cmd_Get($sArg)
MsgBox(64, "", "Ком. строка: " & $sArg)
EndFunc
Func _OnCmdLineFunc($sArguments, $iFuncName)
Local $sArgs = _GetCmdLineEx($CmdLineRaw, $sArguments, 1, "", "-")
If @error Then Return SetError(1, 0, "")
If $sArgs <> "" Then Call($iFuncName, $sArgs)
EndFunc
Func _GetCmdLineEx($sCmdLine, $sArg, $iStripQuotes=1, $sDefault="!NOT FOUND!", $sPar="/", $sVal="=:")
$sPar = "[" & StringRegExpReplace($sPar, "([-^\\])", "\\\1") & "]"
$sVal = "[" & StringRegExpReplace($sVal, "([-^\\])", "\\\1") & " ]"
$sArg = "\Q" & $sArg & "\E"
Local $sRegExp = '(?i)^(?:|.*?\s)'&$sPar&$sArg&$sVal&'+(?:$|'&$sPar&'|((?:"[^"]*"|[^"])+?)(?:$|\s'&$sPar&'\w)).*'
Local $sRetCmd = StringRegExpReplace($sCmdLine, $sRegExp, '\1')
If @extended Then
If $iStripQuotes Then $sRetCmd = StringRegExpReplace($sRetCmd, '\A"+|"+\z', '')
Return $sRetCmd
EndIf
Return SetError(1, 0, $sDefault)
EndFunc