Jump to content
BulForum.com

Generate a File Listing


ack

Recommended Posts

Generate a File Listing from a Windows Explorer Context Menu

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 will generate an editable text file listing of the selected directory.

 

Step 1 - Create A Batch File

 

To create the entry in the context menu it's necessary to first create a .bat file. The format for the .bat file is:

 

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

 

The name of the .txt file can be whatever you'd like it called. In the example above it's filelisting, but it could just as easily be filelist, listoffiles, namedfiles, or even wally if you have a sense of the bizarre. Once you've decided on the name, create the file in Notepad and save the file in your Windows folder as shown below. If you want, just copy and paste the example up above if you don't find wally intriguing

FL01.gif

Step 2 - Modify The Context Menu

 

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. To do this:

 

Open Windows Explorer, click Tools, then click Folder Options.

Click the File Types tab, and then click Folder.

Click the Advanced button and then click New to pen the New Action box shown below.

FL02a.gif

In the New Action (gornata snimka) box, type the name that you want to appear in the context menu. Once again, you have a wide latitude in choices but something akin to Create File Listing will probably be more useful than naming it Martha Stewart. As you can see in the example above, I ditched Martha in favor of Create File Listing. Sorry Martha. Browse to the location where the .bat file you created is located, select it and let it be the Application Used to Perform Actions. Click OK and do the standard Windows dance of Apply and OK again to close all the open windows.

 

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 as I did in the example below.

FL04.gif

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 and the list will be generated and displayed at the bottom of the open window as filelisting.txt. The example below was created from the Sample Music folder shown above. Since it is a text file it can be fully edited, copied, pasted, printed, etc for any purpose.

 

SP32-20040118-091922.gif

 

Note: If for any reason you want to remove the Create File Listing entry from the context menu it will be necessary to edit the registry. This can be accomplished by navigating to HKEY_CLASSES_ROOT\Folder\shell\Create_File_Listing using regedit and deleting the Create_File_Listing key in the left pane. Close regedit and reboot to complete removal.

 

Tva e!

Link to comment
Share on other sites

:) който е ползвал добрия стар DOS, знае много добре за какво служи пренасочване на изхода на някоя команда към файл. Ако ползвате и ДОС метода за конвейерна обработка на командите със символа '|' можете дори още по-трикови неща да изпълнявате :)

Много хубаво ack :) , ако пък някой иска нещо такова за Уинодус, има си програмки и за това, а написването на такава е работа за 5 минути ;)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...