Archive: Redirecting DOS output to current console


Redirecting DOS output to current console
I'm trying to redirect the output of a KiXtart script (running kix32 with the script as a parameter) to the current open DOS console window (if installer is started from a DOS command prompt)

The use for this: I'm creating a silent installer that contains kix32.exe and a kix script. These two files are extracted and then run, currently I'm using ExecWait and that works perfect. Only one thing I would like to improve: the installer should not a new DOS window if the installer is started from a DOS window, only if the installer is run from Explorer a new DOS window should be started. This way the look and feel of a command line tool is created by the installer.

I've already looked at ExecCmd, ExecDos and nsExec, great tools but I don't think I can use them in this case.

Hope I've made myself clear. :)


I don't think this is directly possible. The installer itself would have to be a console application to transfer output to the console window.

-Stu


Hmm.. that's too bad. I've searched the forum for other solutions, but couldn't find anything usefull.


May be this is possible using wm_char, but this is not compatible with Win9x.
So you need a plug-in that can find installer' parent process and, if this is console, send kix command line to it's window and run it. May looks funny.
Another way - to hide kix process and send script output to parent console. ExecDos flushes output, so you can read log file to simulate 'alive output'. Not tested.


@Takhir, thanks for the suggestions, I will definitely take a look at both!