PDA

View Full Version : Print Directory


nedah
02-13-2003, 07:53 AM
I apologise if I have posted this question in the wrong forum but it seemed to me to be a programming matter. If it is more appropriate for one of the now closed forums I shall understand if my query is not accepted.

I have a large number of CDs, each of which holds many folders which in turn hold a number of files. To make it easier to find a particular folder/file I thought I would print a list which I could quickly look through and perhaps eventually scan into a database.

Looking for a way to print such a list (my O/S is Windows XP Home Edition) I found a post by mjc which put me on to MS KB 321379. I followed that procedure to set up printdir.bat, and add to the folder options, without any problem and can now easily print a list of contents of a folder.

However I was still looking for a method to print out a list of folders/files in the root directory of a drive. Eventually I managed to sort out a procedure for this task but I do not know how to set up this procedure so that it can be activated from a short-cut on the desktop or a keyboard shortcut.

Is there a simple method (I have no programming knowledge) of setting up a short-cut?

My CD drive is E and the procedure I am currently using is:-

1. Go to START\PROGRAMS\ACCESSORIES

2. Click COMMAND PROMPT

3. C:\Documents and Settings\Owner>cd C:\ ENTER

4. C:\>E: ENTER

5. E:\>printdir.bat ENTER

(The list should now be printed )

6. E:\>exit ENTER

I shall be grateful for any advice.

david eaton
02-13-2003, 04:12 PM
nedah

To create a shortcut, open mo computer or explorer, locate the batch file, RIGHT-click on it, and the menu includes the option "create shortcut". The shortcut can be moved to desktop or where ever you want.

David

nedah
02-14-2003, 01:13 PM
David
Thanks for the suggestion but unfortunately it does not solve my problem. Before I can implement the print.dir command I need to make sure that I am in the root directory. The only way I know to get to the root directory of E drive, starting from windows, is to follow the procedure set out in my original post. In Word there is a process for writing Macros, which can be assigned to a keyboard short cut, for implementing repetitive tasks. I was hoping that there was a similar feature in Windows so that I could record/save my procedure and recall it by a simple keyboard action or by a shortcut on the desktop.
It has been suggested that all I need is a simple batch file(?) but that is beyond my ken.
nedah

david eaton
02-14-2003, 04:01 PM
Why not put the batch file in the root directory of e: ? It should then avoid all the changing directory commands. It should still execute OK from a shortcut.

David

david eaton
02-15-2003, 06:52 AM
Nedah,
You mention that you might want to scan your printout into a database. Why not arrange for the directory listing to be saved as a text file? The batch file below will save the output to a file dir.txt, and print it as well. If you rename the file to the Cd title, it will be saved for future reference, otherwise, when you run the command again on another CD, it will be overwritten.

Batch file: -
dir e: /s >dir.txt
print dir.txt

Save that as dir.bat, on the desktop, and it will run when you need it.

Works in anything from DOS5 to WinXP (don't know about Win2K)

David

nedah
02-15-2003, 01:47 PM
David,
Many, many thanks for your continued interest in my problem.
I have tried out your batch file and it has given me everything I need plus the ability to save the information for future reference &/or manipulation. Now all I have to do is convince the grandchildren it is all my own work!! Thanks again. nedah (essex)