Here's our Windows 95/98 Tip for.. January 16, 2002
Click Here to see a complete list of all of our previously released Tips!
DOS Command to Send Directory Listing to a Text File
One of the hardest things to do is print a folder's contents. Explorer doesn't do it, and many people find themselves out of luck. However, you can use DOS commands to create a text (TXT) file, then print it from your application of choice.

Suppose you want to print a directory listing for drive C. First, create a text file, such as C:\My Documents\DirListing.txt, from this listing. Select Start, Programs, MS-DOS Prompt, and type the following command line:

dir C:\ /S > C:\MYDOCU~1\DirListing.txt

(Note: The /S switch searches all folders and subfolders. Also, since the Windows name of the My Documents directory exceeds the DOS eight-character limit, we used the directory's DOS name, "MYDOCU~1.")

Now print the listing. Close the MS-DOS Prompt window and use your word processor to open the TXT file you just created. (Don't use Notepad--it can't handle large files.) Print the file as you would any other document. The nice part is, you have access to all of that program's commands, such as page breaks.

In our next tip, we'll show you how to send a directory listing right to the printer without creating a TXT file.