Created
April 23, 2022 19:44
-
-
Save exorcistas/675138bcf3b5a431d866f2bf560a6178 to your computer and use it in GitHub Desktop.
AutoIt function for simple command line I/O
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Func RunCommand($_sCommand) | |
ConsoleWrite(@CRLF & ">> RunCommand: " & $_sCommand & @CRLF) | |
Local $processId = Run(@ComSpec & " /c " & $_sCommand, "", @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) | |
ProcessWaitClose($processId) | |
Local $_stdout = StdoutRead($processId) | |
ConsoleWrite(">> STDOUT: " & $_stdout & @CRLF) | |
Return $_stdout | |
EndFunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment