Computer Hope

Microsoft => Microsoft DOS => Topic started by: S. Tao on July 01, 2004, 10:11:45 AM

Title: Problems with logging - HELP!
Post 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!
Title: Re: Problems with logging - HELP!
Post by: 2k dummy on July 05, 2004, 08:12:55 PM
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.
Title: Re: Problems with logging - HELP!
Post by: SKy on July 07, 2004, 07:11:04 AM
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.
Title: Re: Problems with logging - HELP!
Post by: Suntiger on July 08, 2004, 10:36:18 AM
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.
Title: Re: Problems with logging - HELP!
Post by: MalikTous on July 15, 2004, 06:06:21 PM
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.