raji Posted May 18, 2017 Share Posted May 18, 2017 Hi, Im trying to pass the value from autoit script to Java, while running .exe file of autoit from java. This is my Autoit Script: ------------------------------------ Local $EncryptValue=$CmdLine[1] ;"KytWLOHX7cc=" DecryptorValue($EncryptValue) Func DecryptorValue(ByRef $Encrypt) Local $exeLocation = "D:\study material\Lyca-decryptor\Lycatel.exe" Local $iPID=Run($exeLocation) WinWaitActive("Form1") ControlFocus("Form1","","WindowsForms10.EDIT.app.0.33c0d9d2") ControlSetText("Form1","","WindowsForms10.EDIT.app.0.33c0d9d2",$Encrypt) Call("Sleeper") ControlClick("Form1", "", "WindowsForms10.BUTTON.app.0.33c0d9d1", "Left") Call("Sleeper") Local $Vvalue=ControlGetText("Form1", "", "WindowsForms10.EDIT.app.0.33c0d9d2") ;MsgBox($MB_SYSTEMMODAL, "State and text of the menuitem", "state:" & $Vvalue) ;ConsoleWrite($Vvalue) Local $sOutput = StdoutRead($Vvalue) ;MsgBox($MB_SYSTEMMODAL, "State and text osdgsg", "state:" & $sOutput) Return $Vvalue EndFunc WinClose("Form1") Func Sleeper() Sleep(1000) EndFunc This is my Java code: ---------------------------- String Val="KytWLOHX7cc="; String D1="D:\\AutoItScripts\\decryptor.exe" +" \""+ Val+"\""; System.out.println(D1); Process AutoitReturnValue=Runtime.getRuntime().exec(D1); InputStream in = AutoitReturnValue.getInputStream(); System.out.println(in.read()); I'm getting -1 as return value from autoit Can someone help me with this?? Link to comment Share on other sites More sharing options...
junkew Posted May 18, 2017 Share Posted May 18, 2017 try the examples first https://www.autoitscript.com/autoit3/docs/functions/StderrRead.htm https://www.autoitscript.com/autoit3/docs/functions/StdOutRead.htm and based on that make your scenario work Xandy 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
raji Posted May 19, 2017 Author Share Posted May 19, 2017 Hi @junkew, Thanks for ur reply. I tried using stdoutread.This is My autoit script Local $exeLocation = "D:\study material\Lyca-decryptor\Lycatel.exe" Local $iPID=Run(@ComSpec & $exeLocation,@SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD) while running the script it is not opening .exe file and not proceeding further. can u please help me with this.. 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