DAWN Ontario: DisAbled Women's Network Ontario

Technology Info, Tips, FAQs
You Can Use

Questions & Answers (Q & A)

How to Create a Batch File To Print Contents List of Folder


Question:
"I was wondering if you could give me step-by-step actions on how to create a batch file to print the contents list of any folder on my hard drive."


Answer:

Here's a way to print a folder's contents - a way that will work with any printer installed in Windows.

To create a batch file to perform the above, follow these steps:

Launch Notepad (Start -> Programs -> Accessories -> Notepad) and enter the following three lines:

dir %1 > c:\windows\temp\dir.txt

notepad c:\windows\temp\dir.txt

cls

Make sure that "cls" is on the very last line of the file. You do not want even a blank line below it.

Save the file as: c:\program files\accessories\printdir.bat

That is, name your file: printdir.bat (make sure you use the drop down menu to save the file as a batch file with a .bat extension. Then save it to the accessories folder which is found in the program files directory of your c drive.

Then exit Notepad.

Launch Windows Explorer and select View ** Folder Options (or View ** Options or Tools ** Folder Options).

In the Folder Options dialog box, click the File Types tab.

In the list of 'Registered file types', scroll down to and double-click on "File Folder". (In Windows Me, select File Folder then click the Advanced button.)

In Edit File Type dialog box, click the New button. In the New Action dialog box's Action field, type Print. For 'Application used to perform action' type "c:\program files\accessories\printdir.bat" (don't forget the quotation marks).

Click OK and Close buttons until you're back in Explorer.

From now on, when you want to print a folder's contents, right-click the folder and select Print. The batch file will bring the file list up in Notepad, where you can print it by selecting File ** Print.



Go To: Questions & Answers (Q & A) index page

back to Technology Content Index

 

Return to DAWN Ontario

Events Calendar
events, conferences etc

Featured News & Alerts

What's New
additions to the site indexed daily

Contact Us

Sign our Guestbook!


Website created & maintained
courtesy of Barbara Anello

DAWN Ontario
Box 1138 North Bay, ON P1B 8K4