View Full Version : How to Print Folder and File NAMES only
Ray Stainer
09-29-2002, 07:49 AM
Hi Helpers,
Is there a generally accepted correct way to print folder names and/or file names please. I can do it in DOS but would like to achieve same result from Win98.
Thanks for your help
Ray Stainer
sleddog
09-29-2002, 09:01 AM
Dunno if this is generally acceptable or correct, but here's one way. It's just an extension of what you are already doing in DOS.
1. Put the following lines in a batch file. For the sake of illustration we'll call it printdir.bat and put it in C:\
@echo off
if exist dir.txt del dir.txt
dir /O /A "%1" > dir.txt
notepad.exe dir.txt
2. Start regedit and add a new command for 'folder':
HKEY_CLASSES_ROOT\Folder\shell\print\command
You navigate as far as HKEY_CLASSES_ROOT\Folder\shell, then make a new key 'print', then under 'print' make a new key 'command'.
In the 'command' key, you set 'Default' to C:\printdir.bat
Now when you right-click a folder you have a new option "Print". Clicking it will print the directory listing to a file, which is then opened in Notepad.
You can play with the options for the dir command in the batch file. At a command prompt type dir /? for a list of options.
There are several variations you could use in the batch file. For example you could always output the dir list to the same file (say C:\temp\dir.txt) and set Notepad to open that file. Or you could try using a /print switch to Notepad so it would send the file to your printer on opening, e.g.:
notepad.exe /print dir.txt
I don't have a printer so I can't experiment with that :)
ezpork
09-29-2002, 10:36 AM
Open Windows Explorer and go to the directory that contains your MP3s.
Click the Start button and choose Run (or press Window-R).
Type "command" and press enter.
A DOS window will open to the directory that you selected in Explorer. Type dir > filelist.txt.
Type "exit".
A file with the name filelist.txt has been created in the directory you selected in Explorer.
You can now edit that file so it looks nice and pretty, or merely print it out.
Ray Stainer
09-29-2002, 01:49 PM
Ezpork__________Amazing______________Perfect
Thanks
Ray Stainer
Paul Komski
09-29-2002, 11:15 PM
Ray is obviously a happy bunny now.
Just thought I'd mention a program (800KB) I recently downloaded called TurboNavigator (http://www.turbonavigator.com). It's sooooo cool and efficient compared to Windows Explorer (for Windows-based file management) that I now find WE virtually redundant; it has loads of added functions like folder-comparisons and viewing or editing of any asci files and so on.
In the context of this thread it is probably now redundant but the contents of a folder can be copied to clipboard, to then do with as one pleases. Just the paths, names and file extensions; (but no file sizes, attributes, etc. unfortunately).
Ray Stainer
09-30-2002, 04:05 PM
Thanks Paul,
I'll save the program, and familiarise myself with it.
Happy Bunny
netharam
10-03-2002, 02:07 PM
Hi sleddog I find Your reply exact to the point, but I have a small inconvenience in that. When I select print for a folder it opens notepad with the listing file, but at the same time the dos window also stays open until I close the Notepad window. This seems little disturbing. Can I get rid of this one? If so How? Expecting Your valuable replies.:p
Advanced Thanks.:D
Paul Komski
10-03-2002, 03:49 PM
You could try changing the files properties from RClick<>Properies<>ProgramTab.
eg: Select it to run minimised and to close on exit.
sleddog
10-03-2002, 04:21 PM
Originally posted by netharam
... When I select print for a folder it opens notepad with the listing file, but at the same time the dos window also stays open until I close the Notepad window. This seems little disturbing. Can I get rid of this one?
Just make two slight modifications to the printdir.bat file. Modified version:
@echo off
if exist dir.txt del dir.txt
dir /O /A "%1" > dir.txt
start notepad.exe dir.txt
exit
It's the last two lines that are changed.
Batch files behave somewhat differently on Windows 98 compared to Windows 2000/XP. Which are you using?
netharam
10-07-2002, 02:57 AM
Hi sled I'm using both win98 & win2000. Please look into my profile for further details.:D
vBulletin v3.6.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.