This article was previously published under Q102351
This article has been archived. It is offered "as is" and will no longer be updated.
To redirect the standard input (STDIN) for a console application namedAPP.EXE from a file named INPUT.TXT, the following syntax is used:
app < input.txt
However, the following syntax will not work when attempting to debugthis application using WinDbg with STDIN redirected:
windbg app < input.txt
To debug the application as desired, use
windbg cmd /c "app < input.txt"
This will allow WinDbg to debug whatever goes on in the cmd window. Adialog box will be displayed that says "No symbolic Info for Debuggee."This message refers to CMD.EXE; dismiss this dialog box. When the childprocess (APP.EXE) is started, the command window will read "Stopped atprogram entry point." To continue, type "g" at the command window. Notethat APP.EXE will begin executing, then you can open the source file andset breakpoints.
This technique is also useful when debugging an application that behavesdifferently when run with a debugger than it does when it is run in thecommand window.