RestrictedUser Posted March 8, 2019 Share Posted March 8, 2019 I want to send some commands to Windows Command Prompt by autoit by using @Compsec or cmd.exe /c... I want to watch output of answer in textbox How can i? Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 8, 2019 Share Posted March 8, 2019 @Colduction STDInWrite. Look in the Help file. RestrictedUser 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
RestrictedUser Posted March 8, 2019 Author Share Posted March 8, 2019 2 minutes ago, FrancescoDiMuro said: @Colduction STDInWrite. Look in the Help file. Thanks, but can you give me an example? StdinWrite examples in Help file wasn't useful for me Link to comment Share on other sites More sharing options...
Skysnake Posted March 9, 2019 Share Posted March 9, 2019 It is just a matter of time before someone else asks you for your code. What have you done? What didn't work? Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Trong Posted March 10, 2019 Share Posted March 10, 2019 This is an example of running a command and retrieving data from cmd (may help you) Local $iCommand='ping 8.8.8.8' Local $iReturn=_RunWait($iCommand) MsgBox(262144, $iCommand, $iReturn) Func _RunWait($sCommand) ConsoleWrite("! RUN: " & $sCommand & @CRLF) Local $sOutput, $iPID = Run('"' & @ComSpec & '" /c ' & $sCommand & ' 2>&1', @ScriptDir, @SW_HIDE, 1+2+4) ;$STDERR_CHILD + $STDOUT_CHILD Local $itry = 100 While $itry $sLine = StdoutRead($iPID) If (@error) Then ExitLoop If (Not ProcessExists($iPID)) Then $itry -= 1 If $sLine <> "" Then $sOutput &= $sLine ConsoleWrite($sLine) EndIf WEnd ;~ ConsoleWrite("- OUT: " & @CRLF & $sOutput & @CRLF & @CRLF) Return $sOutput EndFunc ;==>_RunWait zoel and RestrictedUser 1 1 Regards, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now