sivaramanm Posted May 8, 2013 Share Posted May 8, 2013 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. $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) 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