Jump to content

Recommended Posts

Posted

Hello,

We use a package delivery system which can feedback the output from scripts run on a target PC. If we were to run a DOS batch file with the following, it would be fed back into the job output of our delivery system....

Echo This is my job output >> %1
Echo for the batch file I just ran >> %1

My question is, what would be the alternative within AutoIT. Is it even possible? I tried ConsoleWrite, but it doesn't work.

Thanks in advance,

JT

Posted

#include <Constants.au3>

Local $foo = Run(@ComSpec & " /c Echo This is my job output && Echo for the batch file I just ran", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $sStdout, $sStderr
While 1
    $sStdout &= StdoutRead($foo)
    If @error Then ExitLoop
Wend

While 1
    $sStderr &= StderrRead($foo)
    If @error Then ExitLoop
Wend

MsgBox(0, "Debug", "Output:" & @crlf & $sStdout & @crlf & @crlf & 'ErrorMsg:' & @crlf & $sStderr)

Posted

Ahh it's cool. We figured out the software delivery tool is passing a filename which is used for the output. We can open that file directly and dump the output to it.

Cheers for the responses though.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...