Re: listing to a file



I wonder if someone might know how to modify this so that the file it
generates, lands on your desktop every time?

"M8RIX" wrote:

I found this article on how to automate a directory file listing using a
batch file but I cannot remember where I found it. It works really well for
me.
All of the text of the article is here but the pictures are not. I wish I
could remember where I found this so I could give credit where credit is
due.

<Begin article>"How many times have you been browsing through directories in
Windows Explorer and wished you could generate a text file or printout
listing the files and folders? It seems like such a simple request that it's
amazing the option isn't available. You don't believe me? Right-click on a
folder and see for yourself if there is an option to list or print the
structure. There isn't, but there is a workaround that doesn't require any
third-party software. Here's how to create a context menu item that, when
clicked, generates a printable (and editable) text-file listing of the
selected directory.

To create the entry in the context menu it's necessary to first create a
batch file. A batch file is a text file that contains a sequence of commands
for a computer operating system and uses the .bat extension. The format for
the .bat file is:

dir /a /-p /o:gen >filelisting.txt

The name of the .txt file can be whatever you like. In this example, I've
used filelisting.txt, but it could just as easily be filelist, listoffiles,
namedfiles, or even Wally if you enjoy the bizarre in your filenaming
schemes. Once you've decided on the filename, create the file in Notepad, as
shown in .


Figure 1. Creating a batch file in Notepad
Save the file in your WINDOWS folder as shown in , making sure to use the
..bat extension and not the default .txt extension. It's important to set
"Save as type" to All Files and "Encoding:" to ANSI.


Figure 2. Saving file listing.bat
Now that we have the .bat file created, the next step is to make it
functional and easily accessible by integrating it into the context menu
that opens when a right click is executed. Open Windows Explorer and choose
Tools ? Folder Options ? File Types tab ? Folder ? Advanced ? New, to open
the New Action box shown in .


Figure 3. Creating a new action for the context menus
In the Action box, type the name that you want to appear in the context
menu. Once again, you have wide latitude in choices; something like Create
File Listing will probably be most useful, but you can name yours something
more confusing if you like. Browse to the location of the .bat file you
created, and select it in the box labeled "Application used to perform
action." Click OK, and you'll see that Create File Listing (or whatever you
chose as an action name) has been added as one of the Actions in the Edit
File Type window, as shown in . Do the standard Windows dance of clicking OK
again to close all the open windows.


Figure 4. The revised Edit File Type box with your new action
That's it! Congratulations. You've created a new item on the context menu
that's ready to go to work. So, now that's it there, what can you do with
it?

Open up Windows Explorer. Navigate to whatever folder you want to use as the
basis for the file list, and right-click to open the context menu. Click on
the Create File Listing item (see ), and the list will be generated and
displayed at the bottom of the open Notepad window as filelisting.txt. shows
the file listing generated from the Sample Music folder shown in . Since it
is a text file, it can be fully edited, copied, pasted, printed, and so on
for any purpose.


Figure 5. Your new context-menu action: Create File Listing

Figure 6. The generated file listing, all ready for editing and printing
TIP
If for any reason you want to remove the Create File Listing entry from the
context menu, you must edit the Registry [Hack #68]. Navigate to
HKEY_CLASSES_ROOT\Folder\shell\Create_File_Listing and delete the
Create_File_Listing key in the left pane. Close regedit and reboot to
complete removal. <End article>




I hope this helps
--
Mark N.
"Cecilia" <Cecilia@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:98E07187-2453-4409-8144-6ED388C2FF52@xxxxxxxxxxxxxxxx
how can a print the files names of a directory to a text file ?



.



Relevant Pages

  • Re: listing to a file
    ... batch file but I cannot remember where I found it. ... To create the entry in the context menu it's necessary to first create a ... Save the file in your WINDOWS folder as shown in, ... File Listing will probably be most useful, but you can name yours something ...
    (microsoft.public.windowsxp.general)
  • Win Explorer Context Menu Queue it up, Add to Playlist NOT WORK
    ... During all this year by now I noticed one big problem with Windows ... Windows Explorer Right click Context menu on multimedia files (e.g. .mp3, ... In the first, I was thinking that maybe some WMP Plug-in, or Visualizations ... start to install more Software on it. ...
    (microsoft.public.windowsmedia.player)
  • Re: Right Click Crashes Windows Explorer
    ... Wondering why troubleshooting using ShellExView did not isolate the ... Apparently by doing this I insured that PowerDesk's Context Menus load ... What about other shell extensions (not only Context Menu handlers). ... see if the Event Viewer provides any clue on the Windows ...
    (microsoft.public.windows.vista.installation_setup)
  • Re: The basics of Windows messages
    ... When the receiver next calls GetMessageor PeekMessage, Windows will note that there is a sent message pending, and it will route it to the traget window before fetching the next message from the queue. ... My confusion comes mainly from the fact that the documentation for those facilities usually state that they make the calling thread yield "execution so the operating system can process other events." ... does the code in /ProcessMessages/ actually cause a switching of the execution context? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: left click is bringing up context menu
    ... 2004 Windows MVP "Winny" Award ... the context menu never gets corrected. ... >> have tried restoring to a previous day's restore point. ... >> Here's the .reg file I was talking about: ...
    (microsoft.public.windowsxp.general)