Link to home
Start Free TrialLog in
Avatar of geriatrix
geriatrix

asked on

How do I redirect console output from cmd.exe for full-screen console apps

How do I redirect console output from cmd.exe for full-screen console apps, e.g. telnet, edit, etc. I wish to gain access to application input & output.

I'm assuming that either the program (e.g. telnet) or the shell (e.g. cmd.exe) is making calls to the windows console functions, e.g. ReadConsoleOutput, WriteConsoleInput, etc. These functions fail when the STDIN, STDOUT and STDERR streams have been redirected. Does anyone know of code to get and redirect the info? Is it a matter of hooking all the console functions in user32.dll or kernel32.dll?

Thanks for any info.
Avatar of geriatrix
geriatrix

ASKER

OK, platform is PC, OS = Windows XP/Vista, language = {VB.NET, C/C++, C#}. Related applications: maybe powershell.
ASKER CERTIFIED SOLUTION
Avatar of abel
abel
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I showed a link with a solution. This particular question is quite hard to solve, but on the locations of these links is enough information, including full solutions. I don't think this question should be deleted (I already had it in my KB for that matter...)