0

This program Lunar IPS (which create binary patch files) is seemingly ignoring my redirection to null. I'm invoking:

"Lunar IPS" -CreateIPS output.ips input1.txt input2.txt > nul 2>&1

And it gives me a load of output anyway:

Original file: \input1.txt
Modified file: \input2.txt
Patch Creation Complete! : The IPS patch was successfully created!

I want to know either how to do this myself, or (preferably) how to prevent this program from ignoring my redirection.

Note that compared to other similar questions, this one actually does try redirecting both stdout and stderr.

P.JBoy
  • 3

1 Answers1

1

If it was in *nix then it would be like in this question: How/why does ssh output to tty when both stdout and stderr are redirected? The answer is: it uses /dev/tty.

AFAIK the Windows "equivalent" is CONIN$/CONOUT$ [emphasis mine]:

The CreateFile function enables a process to get a handle to its console's input buffer and active screen buffer, even if STDIN and STDOUT have been redirected. To open a handle to a console's input buffer, specify the CONIN$ value in a call to CreateFile. Specify the CONOUT$ value in a call to CreateFile to open a handle to a console's active screen buffer. CreateFile enables you to specify the read/write access of the handle that it returns.

I'm not sure if the program in question does exactly this, but I believe it's a possibility. I don't know how to prevent a program from using CONOUT$ nor how easy or hard it is (if possible at all). In Linux there is setsid, but I don't know Windows well enough to give you a similar solution.