Mick:
This is a little longer answer than you'd asked for but I think it'll come in
handy for yourseld and others. Here goes.
============================================================================
DIRLIST Instruction
=============================================================================
To print a directory from the DOS Prompt
Syntax:
dir [d:\pathname] [/switches] > prn
For example, to print out the c:\netscape directory contents, and sort
the output first by directory, then by name:
dir c:\netscape /ogn > prn
To print the same directory AND any subdirectories in the path, add
the "/s" switch:
dir c:\netscape /ogn /s > prn
To eject the final page of the output, you'll need to send a command to
the printer (see below).
If you do this type of thing periodically, you may want to make up a
little batch file to eject the final page of the output. I call mine
"eject.bat". It is a simple, single line containing the page eject
character (ASCII code 012 or Ctrl + L).
Actually, I put another line in first with the entry "@echo off" -
without the quotes of course. So my batch file looks like this:
@echo off
echo ^L > lpt1
where the "^L" is entered by pressing the Control and L key together
or, enter the eject command in ASCII code by holding down the Alt key,
pressing the 0, 1 and 2 keys on the numeric keypad simultaneously
before releasing the Alt key. The redirect key (>) is then entered
and the echoed command is directed to the parallel printer.
If you use long filenames though, don't forget to enclose the long
filename in double quotes. For example, if you wanted to print the
directory for Program Files, the entry would be:
dir "c:\Program Files" /ogn
If you want a better and more controlled output though, why not send
the directory list output to a file then subsequently editing that file
in your word processor. This gives you the opportunity to change the
font and the pagination, etc. before printing - or simply keeping it.
To append the directory listing to an existing file, use the redirection symbol
">>" as follows:
dir b: >> c:dirlist.txt
. . . and repeat for each additional directory (or floppy disk) until
finished.
--- End of instruction ------------------------------------------------------
Mick Fitzpatrick wrote:
> Hello
>
> Some time ago I asked if it was possible to convert the contents/file names
> of a folder to a text or word document. I was given 2 solutions. One was a
> little utility called PrintFolder. The other solution was a simple line that
> one types at the DOS prompt, I prefer this DOS solution. However I have
> forgot what I should type!!! Any assistance will be appreciated
>
--
Larry Stewart
Ottawa, Ontario
email: [log in to unmask]
PCSOFT maintains many useful files for download
on our web site - visit our download page at:
http://nospin.com/pc/files.html
|