Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Capture Run/DOS command output as well print on STDOUT

$
0
0
I have the following code to capture and process the Run command output.
Now how do i modify such that the Run command window and output is active and at the same time captured and logged?

P.S.Replacing @SW_HIDE with @SW_SHOW or the equivalent just shows the blank command window (all command execution truncated)

Something similar to the function of linux "tee" command which logs into the file as well prints on STDOUT.

[ autoit ]      
$CurrentPID = Run(@ComSpec & ' /c ' & $CurrentLogCmd, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) If Not ProcessWaitClose($CurrentPID,60) Then WriteLog("[Warning] Timed-out.Finding date in current hour raw log -" & $CurrentLogFileName) $F_LogWarningExist=1 Return $C_SUCCESS ; Take chances and proceed with parsing raw logs EndIf $CurrentOutput = StdoutRead($CurrentPID)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>