Skip to content

Capture output of command ? #8

Answered by diversenok
chmichael asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. I just added support for specifying standard input/output handles when using process creation wrappers in 9a8e2b0. This includes wrappers for CreateProcessAsUser, CreateProcessWithTokenW, CreateProcessWithLogonW, NtCreateUserProcess, RtlCreateUserProcess, RtlCreateUserProcessEx, and NtCreateProcessEx. Keep in mind that the last three don't support inheriting the current console, so they will still spawn a new one (which you might want to SW_HIDE), regardless of I/O redirection.

Now it's possible to use anonymous pipes to redirect console I/O, similar to what this Microsoft sample does.

Here is an example of how to use this functionality to capture output of running a cmd command: http…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chmichael
Comment options

Answer selected by chmichael
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants