Piotr_Hodl Posted February 13, 2018 Share Posted February 13, 2018 Hello guys, I am using psexec to execute an autoit exe remotely. My autoit script, in the end of the flow will do some "asserts", where I currently write the results to a log file. So basically I will need to do some checks in order to validate the test, something like this: if result > 3 then _logIt("yes") Where: Func _logIt($ErrorMessage) FileWriteLine(@ScriptDir & "\" & @ScriptName & ".log", @HOUR & ":" & @MIN & ":" & @SEC & ": " & $ErrorMessage) EndFunc I have looked everywhere and I was not able to find something similar of what I am pretending. My goal is: From the original host that is executing the psexec, get the STDOUT of the remote autoit exec script execution. Now I am currently writing to the file, but I wanted to write to STDOUT. Taking the same example, I would be able to see the "yes" string from my original machine executing psexec command. Is this possible? Thanks Piotr Link to comment Share on other sites More sharing options...
Piotr_Hodl Posted February 16, 2018 Author Share Posted February 16, 2018 Bumping for visibiliy. Thanks Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 16, 2018 Share Posted February 16, 2018 Hello and Welcome to the forum! Your question is how to write to STDOUT? Did you search the helpfile for STDOUT? Use ConsoleWrite() and note that part in the helpfile about compiling to CUI/console app. Piotr_Hodl 1 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Piotr_Hodl Posted February 19, 2018 Author Share Posted February 19, 2018 Thanks Admiral, Yes, basically I want to write to stdout, so I am able to catch the result of the test. I indeed saw that option, but I cannot compile into console. Not even when I compile it with: #AutoIt3Wrapper_Change2CUI=y I will make effort today to compile in console mode and let you know. Thanks Link to comment Share on other sites More sharing options...
Piotr_Hodl Posted February 19, 2018 Author Share Posted February 19, 2018 (edited) Nevermind. I add to download back again the editor and now I am prompt with the compile option. Weird, because I thought I add it but this one shows me more options. Anyway, I was able to compile in CUI mode but only when I run the file in CMD I am able to get the STDOUT. Running with PSEXEC opens a new CMD window, that opens and closes to fast and does not redirect STDOUT to PSEXEC. It looks that PSEXEC does not redirect STDOUT of the programs that execute. Thanks anyway Edited February 19, 2018 by Piotr_Hodl 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