Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Directory Structure

Status
Not open for further replies.

JerryG

IS-IT--Management
Nov 19, 2000
12
0
0
US
I have windows 2K pro. Within this I have a single directory where all data is stored. This is done to make backup easier and faster. This structure is several levels deep.

What I want to know is how can I print a listing of the tree (or sub tree) and the files contained there in, i.e. a fully expanded file list.

JerryG
 
Hello, JerryG.

I had posted something similar to win9x forum. But there is some essential difference between win9x and win2000 that is worth noticing. So I post a modified solution for your win2000.

First, I guess there is no reason to print the folder contents very often. So before beginning for a solution, I would suggest rather to list the contents to a text file. Once you decide you need a hardcopy, you can always print the text file.

This is how I make it to the rightclick context menu for this maintenance job.

[1] Click out the File Options (from Explorer | Tools for instance).
[2] From the file types, locate "folder", not the one named "find folder". The known extension for it is "N/A". Click on it and then choose "Advanced" button at the bottom.
[3] You'll see the Actions window, click on the button "New" on the side of it.
[4] Give the new action a name. I use for instance "List folder contents".
[5] In the action input box, enter the action. I use :

c:\winnt\system32\cmd.exe /c dir "%1"/s/o:gn > "%1"_dir.txt

You can use slightly different dir switches and filename. (If you really want to send the result to printer, then redirect the output to lpt1: would do.)
[6] Close out Folder Options by OK's.

What are the advantages of all the above?
[7] It will do the dir listing automatically once you point the mouse over the folder you want to list the contents by rightclick and choose "List folder contents". It is done all along within the Explorer environment. This avoid the annoyance of CD's to the directory in dos box or type in the long directory path.
[8] It will creates the text file name with the convention as follows:

folder to list: ...\upper_level\myfolder
listfile: ...\upper_level\myfolder_dir.txt

at the same level of the myfolder, so that you can immediately locate it without the need to locating it elsewhere. Long folder name (with or without space is supported.)

The above setting is the best possible way to get the job done without 3rd party utility.

[9] However, for win2000, you should be alert rightaway that if once you set up a command line as above and you change your mind, such as you want to use different switches etc, the file options may resist you from editing the "List folder contents" with the Edit button greyed. In this case, you can always go to registry to edit the comment line or delete this item in rightclick menu altogether. I can list the exact key, but the simplest is to use Edit | Find "List folder contents". It is straigtforward. But, just in case you have doubt you can post back for further info.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top