Annoyances.org
Home » Windows 2000 Discussion Forum » Message 1048987144 » Entire Thread Search | Help | Home
  
'Print Out a Directory Listing' in Win2000
Showing all messages in thread #1048987144
Windows 2000 Annoyances Discussion Forum


The following are all of the messages in this thread (9 in all), shown in chronological order. Click any message subject to view that message by itself or to view the thread hierarchy.
'Print Out a Directory Listing' in Win2000
Saturday, March 29, 2003 at 5:19 pm
Posted by WHO (56 messages posted)

Setting PrintDir option in Context menu (Win2000):
    * Save the two-line Print.bat file into your c:\winnt\  folder (win2k).
    * Next, run the Registry Editor (REGEDIT.EXE).
    * Open My Computer\ HKEY_CLASSES_ROOT\ Directory\ shell.
    * Select New from the Edit menu, and then select Key.
    * Type Print for the name of this new key, and press Enter.
    * Highlight the new Print key, select New from the Edit menu, and then select 
Key again.
    * Type command for the name of this new key, and press Enter.
    * Double-click on the (default) value in the right pane, and type 
c:\winnt\PRINTDIR.BAT "%1" (NOTE THE QUOTES!) (assuming that c:\winnt\  is your Windows2000 
folder).



Print.bat, save this file in c:\winnt\:

@echo off
dir %1 /o:ge /x>"%temp%\Listing"
start /w notepad "%temp%\Listing"
del "%temp%\Listing" exit

Nederfox.

[Reply or follow-up to this message]

Tip: Run a free scan for common Windows errors ad

re: 'Print Out a Directory Listing' in Win2000
Sunday, May 4, 2003 at 6:10 am
Posted by Krystyna (1 messages posted)

Thankyou for the instructions...I have been trying to get this working in Win2K, and had forgotten to put "%1" All is okay now.


On Saturday, March 29, 2003 at 5:19 pm, NFX wrote:

>Setting PrintDir option in Context menu (Win2000):
>    * Save the two-line Print.bat file into your c:\winnt\  folder (win2k).
>    * Next, run the Registry Editor (REGEDIT.EXE).
>    * Open My Computer\ HKEY_CLASSES_ROOT\ Directory\ shell.
>    * Select New from the Edit menu, and then select Key.
>    * Type Print for the name of this new key, and press Enter.
>    * Highlight the new Print key, select New from the Edit menu, and then select 
>Key again.
>    * Type command for the name of this new key, and press Enter.
>    * Double-click on the (default) value in the right pane, and type 
>c:\winnt\PRINTDIR.BAT "%1" (NOTE THE QUOTES!) (assuming that c:\winnt\  is your 
Windows2000 
>folder).
>
>
>
>Print.bat, save this file in c:\winnt\:
>
>@echo off
>dir %1 /o:ge /x>"%temp%\Listing"
>start /w notepad "%temp%\Listing"
>del "%temp%\Listing" exit
>
>Nederfox.

[Reply or follow-up to this message]

re: 'Print Out a Directory Listing' in Win2000
Thursday, June 12, 2003 at 10:36 am
Posted by Carl Osterwisch (1 messages posted)

Here's my variation which does not require Registry editing:

Create "dirlisting.cmd":
@echo off
if EXIST %1 goto start
echo Drag and drop files onto this program to grab the directory listing.
pause
goto end
:start
echo "%~dp1"
dir "%~dp1" > dir.txt || pause
start dir.txt
:end

Put a shortcut to this file on your desktop (or wherever).  Drag and drop any file 
onto the shortcut and it will open a window with that file’s directory listing.

[Reply or follow-up to this message]

re: 'Print Out a Directory Listing' in Win2000
Tuesday, October 28, 2003 at 7:56 am
Posted by Erik Berg (1 messages posted)

I'm unclear on how to do this; by "two-line Print.bat file" do you mean the four-line listing at the bottom of the post? And shouldn't the value for the key then be PRINT.BAT instead of PRINTDIR.BAT in the Registry key? How is the command then invoked? Right-clicking while in the directory you want to print? Or from Windows Explorer? Sorry, but I'm a registry newbie...Thanks.


On Saturday, March 29, 2003 at 5:19 pm, NFX wrote:

>Setting PrintDir option in Context menu (Win2000):
>    * Save the two-line Print.bat file into your c:\winnt\  folder (win2k).
>    * Next, run the Registry Editor (REGEDIT.EXE).
>    * Open My Computer\ HKEY_CLASSES_ROOT\ Directory\ shell.
>    * Select New from the Edit menu, and then select Key.
>    * Type Print for the name of this new key, and press Enter.
>    * Highlight the new Print key, select New from the Edit menu, and then select 
>Key again.
>    * Type command for the name of this new key, and press Enter.
>    * Double-click on the (default) value in the right pane, and type 
>c:\winnt\PRINTDIR.BAT "%1" (NOTE THE QUOTES!) (assuming that c:\winnt\  is your 
Windows2000 
>folder).
>
>
>
>Print.bat, save this file in c:\winnt\:
>
>@echo off
>dir %1 /o:ge /x>"%temp%\Listing"
>start /w notepad "%temp%\Listing"
>del "%temp%\Listing" exit
>
>Nederfox.

[Reply or follow-up to this message]

re: 'Print Out a Directory Listing' in Win2000
Sunday, April 4, 2004 at 10:26 am
Posted by Barrie (3 messages posted)

I'm using XP, but as far as I know, XP & 2K are basically the same, so the following should be the same for both OS's. I don't use 2K, so I can't check for differences.

My method is similar to those already posted, but a) doesn't involve editing the registry and b) creates a text file rather than just outputting to printer. That way you can alter the file in Notepad before printing if necessary...

1. Open Notepad, and then copy and paste the following three lines of text into it:

@echo off

dir %1 /-p /S /D /o:gn > C:\Temp.txt

exit

2. Save the file as Dir2Txt.bat in the root of the C:\Windows directory, and then close Notepad.

3. Start Windows Explorer, click Tools, and then click Folder Options.

4. Click the File Types tab, and then scroll down the list of registered file types until you find the Folder entry in the 'File Types' column. (You may find it easier to find if you sort the entries alphabetically by clicking on the grey bar at the top of the 'File Types' column).

5. Click on the Folder entry to highlight it.

6. Click on the Advanced button.

7. Click on the New button.

8. In the Action box, type Directory To Text File.

9. In the 'Application used to perform action' box, click browse and locate the Dir2Txt.bat you saved in step 2. Then click OK.

10. In the Edit Filetype box, click on the Explore action and then on the Set Default button. Explore will turn to bold.

11. Click on OK then on OK again.

12. Open Windows Explorer, right-click the folder that you would like to create a text file of, and you should see a new entry - Directory To Text File. Click on it and a text file called C:\Temp.txt will be created. This file can be opened with Notepad and will contain a detailed listing of the directory's contents - including sub-directories. This can be printed out if required after formatting.

Note: The required filename (C:\Temp.txt) can be changed in the bat file if required and the existing text file is overwritten each time, so move or rename it if you want to keep it.

If anything isn't 100% correct for Win2K in this post, perhaps someone can post an amended version?

BC

[Reply or follow-up to this message]

re: 'Print Out a Directory Listing' in Win2000
Friday, March 4, 2005 at 8:51 pm
Posted by Frank (1 messages posted)

Very nice solution. There is a typo in your instructions. The name of the batch file must be "printdir.bat" (not "print.bat"). Thanks very much for your instructions.


On Saturday, March 29, 2003 at 5:19 pm, WHO wrote:
>
>Setting PrintDir option in Context menu (Win2000):
> * Save the two-line Print.bat file into your c:\winnt\ folder (win2k).
> * Next, run the Registry Editor (REGEDIT.EXE).
> * Open My Computer\ HKEY_CLASSES_ROOT\ Directory\ shell.
> * Select New from the Edit menu, and then select Key.
> * Type Print for the name of this new key, and press Enter.
> * Highlight the new Print key, select New from the Edit menu, and then select
>Key again.
> * Type command for the name of this new key, and press Enter.
> * Double-click on the (default) value in the right pane, and type
>c:\winnt\PRINTDIR.BAT "%1" (NOTE THE QUOTES!) (assuming that c:\winnt\ is your Windows2000
>folder).
>
>
>
>Print.bat, save this file in c:\winnt\:
>
>@echo off
>dir %1 /o:ge /x>"%temp%\Listing"
>start /w notepad "%temp%\Listing"
>del "%temp%\Listing" exit
>
>Nederfox.

[Reply or follow-up to this message]

re: 'Print Out a Directory Listing' in Win2000
Saturday, January 7, 2006 at 6:48 pm
Posted by Ben (1 messages posted)

THANK YOU!!! You did this post two years ago, but I was sitting here going crazy because I needed a directory listing to paste into Excel. You explaination was great. I've seen similar solutions but I didn't understand them, and my computer has admin restrictions. Thanks. Only things I saw that had differences but didn't effect me were:
>2. Save the file as Dir2Txt.bat in the root of the C:\NTWIN, and then close Notepad.
>11. Click on OK then on CLOSE again _____________________________________


On Sunday, April 4, 2004 at 10:26 am, Barrie wrote:
>I'm using XP, but as far as I know, XP & 2K are basically the same, so the following
>should be the same for both OS's. I don't use 2K, so I can't check for differences.
>


>
>My method is similar to those already posted, but a) doesn't involve editing the
>registry and b) creates a text file rather than just outputting to printer. That
>way you can alter the file in Notepad before printing if necessary...


>
>1. Open Notepad, and then copy and paste the following three lines of text into it:
>


>
>@echo off


>dir %1 /-p /S /D /o:gn > C:\Temp.txt


>exit


>
>2. Save the file as Dir2Txt.bat in the root of the C:\Windows directory, and then
>close Notepad.


>
>3. Start Windows Explorer, click Tools, and then click Folder Options.


>
>4. Click the File Types tab, and then scroll down the list of registered file types
>until you find the Folder entry in the 'File Types' column. (You may find it easier
>to find if you sort the entries alphabetically by clicking on
>the grey bar at the top of the 'File Types' column).


>
>5. Click on the Folder entry to highlight it.


>
>6. Click on the Advanced button.


>
>7. Click on the New button.


>
>8. In the Action box, type Directory To Text File.


>
>9. In the 'Application used to perform action' box, click browse and locate the Dir2Txt.bat
>you saved in step 2. Then click OK.


>
>10. In the Edit Filetype box, click on the Explore action and then on the Set Default
>button. Explore will turn to bold.


>
>11. Click on OK then on OK again.


>
>12. Open Windows Explorer, right-click the folder that you would like to create a
>text file of, and you should see a new entry - Directory To Text File. Click on it
>and a text file called C:\Temp.txt will be created. This file can be opened with
>Notepad and will contain a detailed listing of the directory's contents - including
>sub-directories. This can be printed out if required after formatting.


>
>Note: The required filename (C:\Temp.txt) can be changed in the bat file if required
>and the existing text file is overwritten each time, so move or rename it if you
>want to keep it.


>
>If anything isn't 100% correct for Win2K in this post, perhaps someone can post an
>amended version?


>
>BC

[Reply or follow-up to this message]

re: 'Print Out a Directory Listing' in Win2000
Wednesday, March 1, 2006 at 6:33 pm
Posted by norman (2 messages posted)

well these are enchanting BUT how can i hit a button or click a click and get dir > lpt funcionality! (i think that is how it went) (to print a directory listing from a command line) yooose guys all went crazy on making a file i would like just to print the listing


On Saturday, March 29, 2003 at 5:19 pm, WHO wrote:
>
>Setting PrintDir option in Context menu (Win2000):
> * Save the two-line Print.bat file into your c:\winnt\ folder (win2k).
> * Next, run the Registry Editor (REGEDIT.EXE).
> * Open My Computer\ HKEY_CLASSES_ROOT\ Directory\ shell.
> * Select New from the Edit menu, and then select Key.
> * Type Print for the name of this new key, and press Enter.
> * Highlight the new Print key, select New from the Edit menu, and then select
>Key again.
> * Type command for the name of this new key, and press Enter.
> * Double-click on the (default) value in the right pane, and type
>c:\winnt\PRINTDIR.BAT "%1" (NOTE THE QUOTES!) (assuming that c:\winnt\ is your Windows2000
>folder).
>
>
>
>Print.bat, save this file in c:\winnt\:
>
>@echo off
>dir %1 /o:ge /x>"%temp%\Listing"
>start /w notepad "%temp%\Listing"
>del "%temp%\Listing" exit
>
>Nederfox.

[Reply or follow-up to this message]

re: 'Print Out a Directory Listing' in Win2000
Wednesday, March 1, 2006 at 6:37 pm
Posted by norman (2 messages posted)

freakn thing where did my response go? i just want to have a listing print NOT make a file then open notepad and print it ...


On Saturday, March 29, 2003 at 5:19 pm, WHO wrote:
>
>Setting PrintDir option in Context menu (Win2000):
> * Save the two-line Print.bat file into your c:\winnt\ folder (win2k).
> * Next, run the Registry Editor (REGEDIT.EXE).
> * Open My Computer\ HKEY_CLASSES_ROOT\ Directory\ shell.
> * Select New from the Edit menu, and then select Key.
> * Type Print for the name of this new key, and press Enter.
> * Highlight the new Print key, select New from the Edit menu, and then select
>Key again.
> * Type command for the name of this new key, and press Enter.
> * Double-click on the (default) value in the right pane, and type
>c:\winnt\PRINTDIR.BAT "%1" (NOTE THE QUOTES!) (assuming that c:\winnt\ is your Windows2000
>folder).
>
>
>
>Print.bat, save this file in c:\winnt\:
>
>@echo off
>dir %1 /o:ge /x>"%temp%\Listing"
>start /w notepad "%temp%\Listing"
>del "%temp%\Listing" exit
>
>Nederfox.

[Reply or follow-up to this message]

Tip: Use one of the [Reply or follow-up to this message] links above to add a message to this thread
Return to the Windows 2000 Discussion Forum


All content at Annoyances.org is Copyright © 1995-2009 Creative Elementtm All rights reserved.
Please do not plagiarize; redistributing these pages without permission is strictly prohibited.