Handle Windows command prompt input from keyboard and display output and also redirecting it to a file?
<p>Though I can find few relevant questions such as <em><a href="https://stackoverflow.com/questions/796476/displaying-windows-command-prompt-output-and-redirecting-it-to-a-file">Displaying Windows command prompt output and redirecting it to a file</a></em> and <em><a href="https://stackoverflow.com/questions/503846/how-do-i-echo-and-send-console-output-to-a-file-in-a-bat-script">How do I echo and send console output to a file in a bat script?</a></em>, I could not fix my problem. I am working on Windows&nbsp;XP and running a few scripts using a batch file which uses STDIN and STDOUT handles.</p>

<p>Basically, I want to save the log file of command prompt. This is possible with "echo >> log.txt" in a batch file. However, this is not saving the outputs generated as a result of the script file. So I tried at the cmd prompt itself as D:>file.bat >"dir_path/log.txt". Again, this command saves the STDOUT to log.txt at the specified location. Since I need to get a few user inputs i.e. to use the STDIN handle, how do I achieve this in addition to saving the outputs of command prompts in separate file too?</p>