Here's our Windows 95/98 Tip for.. January 30, 2002
Click Here to see a complete list of all of our previously released Tips!
Switches for Printing Directory Listings from DOS
In our last tip, we showed you how to send a directory listing directly to your printer: Exit to a DOS prompt, type the command line

dir C:\ /S > prn

and press Enter. (Note: The /S switch searches all folders and subfolders.)

Now let's look at a couple of switches to customize these listings. To print a listing of all the directories and subdirectories on a drive, but not the files inside them, use the /AD switch:

dir C:\ /AD/S > prn

To print a detailed listing (for example, including long filenames) of all the files in a folder, not including the folder's subdirectories, use the /V switch:

dir C:\{path to directory} /V > prn

To add subdirectories and their files to the above detailed listing, add the /S switch:

dir C:\{path to directory} /V/S > prn

Finally, to send the information to a TXT file instead of directly to the printer, just substitute the "prn" in any of the above commands with the path and name of a TXT file.