Computer Hope
Microsoft => Microsoft DOS => Topic started by: S. Tao on July 01, 2004, 10:11:45 AM
-
I have a problem in that I know there is a way to echo/print all input and output of a DOS box to a text file, but I cannot remember how to do it. Does anyone here know how?
Thanks!
-
You need to be more specific in what you are trying to do. When redirecting input/output you can't have your cake and eat it too.
-
mayb u can use >
example c:\ dir > test.txt
re-directs the output from 'dir' command to the file 'test.txt'
u can use it for printer... i think the command is
> lpt1
change lpt1 to the name of your printer port
can also use >> for appending to the end of a file.
-
Yeah, I know about > and >>, but that would require me to type >> C:\txt.txt after every command. What i'm looking for is more of a way to automatically create a text logfile containing all input/output for the session I'm in, preferably by typing a command at the beginning of said session. So what I'm really looking for is a way to pipe everything that has been displayed in the DOS box to a file. I'm fairly certain it can be done, I have simply forgotten how.
-
I think you use mode con:=prn: before the section you want to print, then mode con:=con: or mode con:=stdio: at the end. If you don't return con: (console) to default after running the file, DOS will continue to send all its output to PRN: (printer on LPT1:) or whatever other port it has been assigned (a terminal on COM1:, the null device (nul:), etc.