How to print the contents of a Windows95 folder Page
JohnKalpus.com
(How to add a "Print Directory" command to a context menu in Explorer)
To begin">

 

How to print the contents of a Windows95 folder Page
JohnKalpus.com
(How to add a "Print Directory" command to a context menu in Explorer)
To begin, open an MS-DOS Prompt window. When Windows 95 opens such a window, it always sets the DOS prompt to the Windows 95 folder. You can create the batch file in this folder, or you can use the change directory (CD) command to change to any folder you want. For example, suppose you want to create the batch file PrintDir.bat in the \Batch folder. You'd use the command CD\Batch.
Once you're in the desired folder, type the following three lines, pressing [Enter] after each one:
copy con PrintDir.bat
dir %1 /on > prn
echo ^L > prn
(Remember, DOS represents [Ctrl]L with the special character ^L on the command line.) To close the file and save it,  press [F6] and then press [Enter]. (Notice that DOS represents [F6] with the special character ^Z on the command line.) At this point, close the MS-DOS Prompt window.
Now that you've created the batch file, you need to configure it so that it behaves like a Windows command rather than a DOS program. To do so, you'll configure the batch file to run in the background. To begin, open either My Computer or Windows Explorer and locate the PrintDir.bat file. When you do, right-click the file and select the Properties command from the context menu. When the PrintDir.bat Properties sheet appears, click the Program tab. Now, select the Minimized option in the Run dropdown list and select the Close on exit check box. As soon as you click OK, you'll notice that Windows 95 automatically creates a shortcut to the PrintDir.bat file. You now need to associate this shortcut with the Folder type.
Once you associate the batch file's shortcut with the Folder type, you'll be able to run the batch file by selecting it from any regular or shortcut folder's context menu. First, pull down the View menu in either My Computer or Windows Explorer and select the Options... command. When the Options properties sheet appears, click the File Types tab. Now, scroll through the Registered file types list and select the Folder option, then click the Edit... button.

Folder options.jpg (31878 bytes)

When you do, the Edit File Type dialog box opens, (If you haven't installed Internet Explorer, your Edit File Type dialog box will look a little different.)

Now, click the New... button to open the New Action dialog box, type Print Directory in the Action text box. This will become the context menu command associated with the batch file. Now, click the Browse... button and use the Open With dialog box to locate the shortcut to the batch file, which will be in the same folder as the batch file itself

Edit File Type.jpg (25828 bytes)

For example, if you saved PrintDir.bat in the \Batch folder, you'll find the shortcut there too. When you select the shortcut, you'll notice in the File Name text box that the file extension is PIF, which stands for Program Information File (this is the way Windows 95 identifies a shortcut to a DOS program). To continue, click the Open button and then click OK in the New Action dialog box. When you return to the Edit File Type dialog box, you'll see that the Print Directory command now appears in the Actions list box. To complete the procedure, click Close twice--once to close the Edit File Type dialog box and once to close the Options properties sheet.
Still confused? Download the PrintDir.Bat file and follow the instructions above.
Click to download PrintDir.bat. file

John Kalpus - "Dr. Discovery" 
DrDscovery@aol.com 
P.O. Box 83211 San Diego, CA  92138-3211
Speaker  Author  Educator
               Keynotes  Breakouts  Consulting Services