Vlad1234 Posted January 29, 2010 Share Posted January 29, 2010 Hello, I have an issue with writing data to the input stream of a process that was not launched by AutoIt functions (Run function). I have this process tree: RAServer.exe (remote agent controller for Junit testing) -> CMD.exe -> setupWIN.exe -> java.exe It would be of tremendous help if I could write to the input stream of java.exe (java.exe is launched by setupWIN.exe) I tried to write data using StdinWrite (I gave the pid obtained from tasklist) but it didn't work. When setupWIN.exe is launched by the RAServer.exe (as the example above), I do not have access to the console of java.exe. That is why I cannot use the Send function to simulate pressing keys. Therefore, I turned my attention to using processes but it seems that StdinWrite doesn't work. Do you have any idea how could I write data to the input stream of java.exe? Any help will be greatly appreciated. Thank you. Link to comment Share on other sites More sharing options...
BoonPek Posted October 24, 2011 Share Posted October 24, 2011 (edited) Sorry for bumping this here, but the issue here also pertains to mine. Here's my code thus far; it doesn't seem to function despite being tinkered with for several hours =.=" expandcollapse popup#include <Constants.au3> #include <GuiConstantsEx.au3> $mGUI = GUICreate('My Test GUI', 800, 550, -1, -1) $sProc = Run('cmd.exe', @ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDERR_MERGED) $sText = GUICtrlCreateEdit('', 10, 10, 780, 500) $sInput = GUICtrlCreateInput('', 10, 520, 700, 20) $sEnter = GUICtrlCreateButton('Send', 720, 520, 70, 20) GUISetState(@SW_SHOW, $mGUI) While 1 $msg = GUIGetMsg($mGUI) Switch $msg Case $GUI_EVENT_CLOSE ProcessClose($sProc) ExitLoop Case $sEnter If GUICtrlRead($sInput) <> '' Then StdinWrite($sProc, GUICtrlRead($sInput)) GUICtrlSetData($sInput, '') EndIf EndSwitch If ProcessExists($sProc) Then $sRead = StdoutRead($sProc) If $sRead <> '' Then $sRead = StringReplace($sRead, @LF, @CRLF) $sRead = GUICtrlRead($sText) & $sRead GUICtrlSetData($sText, $sRead) EndIf EndIf WEnd Edited October 24, 2011 by BoonPek Link to comment Share on other sites More sharing options...
BoonPek Posted October 25, 2011 Share Posted October 25, 2011 Managed to get that working by adding an "@LF" after sending the input! This doesn't seem to work with java-based apps, though :/ Link to comment Share on other sites More sharing options...
DesireDenied Posted October 25, 2011 Share Posted October 25, 2011 does not seems to work for me at all. commands are not even beeing passed nor to cmd console or scripts edit box. 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