PDA

View Full Version : Printing folder contents via batch file


ZEUS_GB
06-07-2004, 03:47 AM
There are many ways of printing the contents of a folder but the easiest way i've found is via a batch file. A batch file is a executable file that can automate tasks.

Setting up a batch file
Open notepad type or copy and paste the following code.

@dir %1 /-p /o:gn > "%temp%\dir.txt"
@notepad /p "%temp%\dir.txt"

Then save the file with a .bat extension (for example printdir.bat) and save it to the sendto folder located on your hard drive.

For 2000/XP: c:\documents and settings\<username>\sendto

For 9x: c:\windows\sendto

For ME: I've got no real experience with ME so you'll have to do a search for it.

How to use
Then when you want to print the contents of a folder use windows explorer, right click the folder, select sendto and click on the file you saved.

What it does
The batch file automatically runs the dir command sorts it in alphabetic order and groups directories, then it redirects the output to a text file that it saves in the temp directory. After it saves the file it opens notepad, prints the file and then closes notepad.

Is it customisable
You can change how the information is displayed. Open a command prompt and type dir /? it will then list the available switches that can be used with the dir command and then simply edit the batch file accordingly.

Ranger Bob
06-07-2004, 09:20 AM
Here is a nice program to print the contents of folders.

Karen's Directory Printer v4.3 = http://www.karenware.com/powertools/ptdirprn.asp

johng
06-08-2004, 08:40 AM
Print Folder 2.1 from
http://no-nonsense-software.com/freeware/
John

Eve
06-08-2004, 09:01 PM
I have used Print Folders (an earlier version)from here http://www.stratopoint.com/products/printfolders.htm

BlueIndian
06-09-2004, 03:18 PM
cool I have to try one of them.