How to Print a Folder (Directory) Listing  

Posted by Nanda Guduri in

How to Print a Folder (Directory) Listing

The following instructions explain how to print a folder listing directly to your printer or to copy the listing to a text file that you can open (and format) in a text editor or word processor before printing.

Printing a List of Files Directly to Your Printer

1. Exit to a command prompt by clicking Start on the Taskbar and choosing Programs, then Command Prompt.
2. To print a list of files in a folder on your computer's hard disk, type the following command at the prompt (e.g., C:\>), replacing c:\folderpath with the full path to the folder you want to print ( e.g., c:\MyFiles). (See also NOTE, below.)

dir c:\folderpath > prn:

3. Tap the ENTER key.
4. Most likely the list won't print until you initiate a form feed on your printer. On an HP laser printer, press the On Line button and then the Form Feed button. When the list has finished printing, press the On Line button again.
5. When finished printing your folder list(s), at the command prompt type Exit and tap the ENTER key to return to Windows NT/95.

Note: If you want to print a listing of the files on a floppy disk (such as A:), in Step 2 (above) type the following (replacing a: with a different drive designation, if appropriate) :

dir a:\ > prn:


Copying a Folder List to a File Before Printing

1. Exit to a command prompt by clicking Start on the Taskbar and choosing Programs, then Command Prompt.
2. To copy a list of files in a folder on your computer's hard disk and place the resulting file in the root directory on your C drive, type the following command at the prompt ( e.g., C:\>), replacing c:\folderpath with the full path to the folder you want to print (e.g., c:\MyFiles). (See also WARNING and NOTES, below).

dir c:\folderpath > c:\folderlist. txt


3. Tap the ENTER key.
4. When finished copying your folder list(s), at the command prompt type Exit and tap the ENTER key to return to Windows NT/95.
5. Open, edit/format, and print as follows:

o You can open a file containing a folder list in the text editor Notepad by simply opening (double-clicking) My Computer and double-clicking the name of the text file you want to open ( e.g., folderlist.txt) . Edit and print as desired.
o If you want to edit or format a folder listing in ways that aren't possible in a simple text editor, you can open the file in your word processor. Be sure to choose a "text" file type ( Text Files in Word 97) and to "look in" the correct folder [such as (C:)]. Edit, format, and print as desired.



WARNING: If you already have a file saved as c:\folderlist. txt, the file created in this procedure will overwrite the previously saved file. If you don't want to overwrite the existing file, choose a name you haven't already used.



Notes:

* If you want to copy the list of the files on a floppy disk (such as A:), type the following at the command prompt (replacing a: with a different drive designation if appropriate) :

dir a:\ > c:\folderlist. txt

* If you want to place the file list somewhere other than the root directory of your C drive, type the full path name for the resulting file (e.g., c:\MyFiles\folderli st.txt).
* If you plan to copy several folder lists, do one of the following:
o Make a separate file for each list, making sure to give each text file a different name (using the name of the folder being copied, for example, such as worddocs.txt or exceldocs.txt) .
o Create one file and append each folder list by using the following command (notice there are two right angle brackets rather than one):


dir c:\ >> c:\folderlist. txt


* When you no longer need the file(s) containing your folder listing(s), be sure to remember to delete it (them).

This entry was posted on Thursday, July 24, 2008 at 10:57 AM and is filed under . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment