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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.