Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS command to send screen to a file. 3

Status
Not open for further replies.

TommyTea

Programmer
Nov 7, 2002
43
US
Does anyone remember the DOS command to send screen output to a file.
I thought it was like:

c:\ reglog.cmd /switch > log.txt

I guess I am getting very old.
 
Your bang on

dir c: > test.txt

outputs the contents of your c: drive to the file named test.txt



Greg Palmer

----------------------------------------
Any feed back is appreciated.
 
There's a couple of switches you can use:
/s includes any subfolders and their files
/o organizes by name
/p [for screen only] pauses one screen at a time
>prn or >LPT1 sends the output to the printer instead of the screen
dir /? opens the Help file for more switches.
 
It all depends on the tool(s) being used in the cmd file: They have to support output redirection to make this work.

My old Clipper apps are all DOS apps, but none of them supports output redirection, so all output is written directly to the screen buffer (in memory), and not through DOS functions so they could be sent to a file.
A mere/simple tool from the commandline like dir, does support redirection, because it works with stdio, other tools like Norton's (old) textsearch (ts) can have a special option (/log) to enable output redirection.
Sometimes a special switch like /ansi offers the possibility to generate ansi-driven output that *is* redirectable, but the downside would be that there are a lot of escape sequences in the file, and output is very slow, and also not visible on the screen.

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top