Jump to content

Search the Community

Showing results for tags '$cmdlineraw'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. Full Document: https://www.autoitscript.com/autoit3/docs/intro/running.htm Application used for checking CMD input into the application! (Attached with source) Use: testCMD.exe CMD1 CMD2 CMD3 CMD.n.. Quick source: #NoTrayIcon ;~ #include <WinAPIShPath.au3> Global Const $iShow_MsgBox = 1, $iCmdLineRaw = @Compiled ? $CmdLineRaw : "" ;//; $CmdLineRaw ; StringReplace($CmdLineRaw, '/ErrorStdOut "' & @ScriptFullPath & '" ', "") Global $icmdMsgBox, $icmdConsole, $iCmdLine = _WinAPI_CommandLineToArgv($iCmdLineRaw) Global $ExeInfo = "-Execute: " & @ScriptFullPath & @CRLF & "-Working Dir: " & @WorkingDir Global $SysInfo = "> " & @OSVersion & "/" & @OSArch & "/" & @OSServicePack & " - UserName: " & @UserName & " (Is Admin = " & IsAdmin() & ")" ConsoleWrite(@CRLF & $SysInfo & @CRLF & "+ CommandLine Checker " & @CRLF) If @error Or ($iCmdLine[0] = 0) Then ConsoleWrite("! Error: no comnand line!" & @CRLF & @CRLF) If $iShow_MsgBox Then MsgBox(48 + 262144, "CommandLine Checker", "Error: no comnand line!" & @CRLF & @CRLF & $ExeInfo & @CRLF & @CRLF & $SysInfo) Exit 1 EndIf ConsoleWrite($ExeInfo & @CRLF & "+ Comnand List:" & @CRLF) For $i = 1 To $iCmdLine[0] $icmdConsole = "- CMD_" & $i & " = " & $iCmdLine[$i] & @CRLF ConsoleWrite($icmdConsole) $icmdMsgBox &= " " & $icmdConsole Next If $iShow_MsgBox Then MsgBox(64 + 262144, "CommandLine Checker", $ExeInfo & @CRLF & "+ Comnand List:" & @CRLF & $icmdMsgBox & @CRLF & @CRLF & $SysInfo) Exit 0 #Region Internal Functions :: WinAPIShPath.au3 Func _WinAPI_CommandLineToArgv($sCmd) Local $aResult[1] = [0] $sCmd = StringStripWS($sCmd, 1 + 2) ;$STR_STRIPLEADING = 1 / $STR_STRIPTRAILING = 2 If Not $sCmd Then Return $aResult EndIf Local $aRet = DllCall('shell32.dll', 'ptr', 'CommandLineToArgvW', 'wstr', $sCmd, 'int*', 0) If @error Or Not $aRet[0] Or (Not $aRet[2]) Then Return SetError(@error + 10, @extended, 0) Local $tPtr = DllStructCreate('ptr[' & $aRet[2] & ']', $aRet[0]) Dim $aResult[$aRet[2] + 1] = [$aRet[2]] For $i = 1 To $aRet[2] $aResult[$i] = _WinAPI_GetString(DllStructGetData($tPtr, 1, $i)) Next DllCall("kernel32.dll", "handle", "LocalFree", "handle", $aRet[0]) Return $aResult EndFunc ;==>_WinAPI_CommandLineToArgv Func _WinAPI_GetString($pString, $bUnicode = True) Local $iLength = _WinAPI_StrLen($pString, $bUnicode) If @error Or Not $iLength Then Return SetError(@error + 10, @extended, '') Local $tString = DllStructCreate(__Iif($bUnicode, 'wchar', 'char') & '[' & ($iLength + 1) & ']', $pString) If @error Then Return SetError(@error, @extended, '') Return SetExtended($iLength, DllStructGetData($tString, 1)) EndFunc ;==>_WinAPI_GetString Func _WinAPI_StrLen($pString, $bUnicode = True) Local $W = '' If $bUnicode Then $W = 'W' Local $aRet = DllCall('kernel32.dll', 'int', 'lstrlen' & $W, 'struct*', $pString) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc ;==>_WinAPI_StrLen Func __Iif($bTest, $vTrue, $vFalse) Return $bTest ? $vTrue : $vFalse EndFunc ;==>__Iif #EndRegion Internal Functions :: WinAPIShPath.au3 ; * -----:| Dao Van Trong - TRONG.WIN CMDtest.zip
  2. Hello! I am back with another IIAGI? (Is it a Good Idea?) I think $CmdLineRaw is more like a macro than a "special" variable (which cannot be changed)... So making ti @CmdLineRaw would make more sense and there will 1 less exception to variables , I know that you were wondering about the $CmdLine "special" array... I didn't forgot it, but I don't think a macro can be a array, so I just ignored it... Maybe removing the $CmdLine and changing $CmdLineRaw to @CmdLine would be nice if you ask me . Think before choosing! TD P.S Feel free to disagree with me, I want hear your opinion as well .
×
×
  • Create New...