In Windows 7, I have a batch file that runs an exe in the sub-directory of bat file, it first changes current directory to that folder, then runs the exe. But something goes wrong, I see a console window for a very short time and the program doesn't start. Since the output console is displayed for less than a second, I can't see the error message.
bat file is:
cd /d "%~dp0my_subfolder"
start "" myapplication.exe
How do I redirect the output error message to a text file (the text file will be in the same directory with bat file), so that I can read the error message? What command should I add to the bat file above?
pausecommand after the batch's last command to be able to read the output in the console window before it disappears.