Go Back   Digit's Technology Discussion Forum > Community > Tutorials

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26-01-2007, 04:22 PM
sridatta's Avatar
sridatta sridatta is offline
An Esoteric Geek
 
Join Date: Mar 2006
Location: Bangalore
Posts: 285
Send a message via Yahoo to sridatta
Lightbulb Tutorial : How to generate Folder/File Listing of a Directory?

Hello Guys...

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 a simple request, but it's amazing the option isn't available by default. Many Third party softwares now provide this option. But why not we do it ourselves??

Here is a go....

Now, our aim is to include the option Save folder Listing into our context menu. To create the entry in the context menu it's necessary to make a command that generate folder listing.

Download the attachment and unzip it. Copy the file into c:\windows directory.

Open Windows Explorer and choose Tools --> Folder Options
Navigate to File Types --> Folder --> Advanced--> New, to open the New Action box shown







Enter the fields as shown below (or in the image above)

Code:
Action : Save Folder Listing to File
Application : C:\windows\dir2file.exe
Note: The path specified above should be same as the path where the extracted attachment file is copied. Otherwise, windows will throw an exception.

And That's it! Congratulations. You've created a new item on the context menu that's ready to go to work.

Open My Computer and browse to any path, rightclick on the folder and click "Save Folder Listing to File" , choose the path and save it to a filename. you are done..

Alternate ways :

Since, editing the folder options is sometimes risky, you can directly add the following registry keys.

Create the Key Save Folder List in the following path

HKEY_CLASSES_ROOT\Folder\shell\

Create a sub key called Command in the Save Folder List key

Edit the default value to "c:\windows\dir2file.zip" "%1" (as it is, with quotes)


For Advanced users:

We can also create a batch file script for redirecting the output of a dir command into a file. People who want to proceed further, can use this command.

Code:
dir /a /-p /o:gen >filelisting.txt
The above command, when executed in the command prompt, will save the Output of DIR Command to filelisting.txt in the current directory. You can also use this batch file to run instead of the dir2file.exe and follow the same method as above, but there are some issues with it. If you succeed doing this, please let me know.

PS: Please Post your comments if any.

For Newbies, I have created an utility which will automate the whole process in a single click. You can download it from here. You can also find the Help file in the Programfiles\Dash\FolderList directory.
http://sridatta.110mb.com/software/folderlist.exe
Attached Files
File Type: zip dir2file.zip (31.4 KB, 59 views)

Last edited by sridatta; 29-01-2007 at 02:35 PM.
Reply With Quote
  #2  
Old 26-01-2007, 06:55 PM
anandk's Avatar
anandk anandk is offline
Distinguished Member
 
Join Date: Mar 2005
Location: Pune
Posts: 3,764
Send a message via MSN to anandk
Default Re: Tutorial : How to generate Folder/File Listing of a Directory?

nice. u have my rep try to post the source when posbl.
more here http://hacks.oreilly.com/pub/h/611
keep it up !
__________________
> www.TheWindowsClub.com <
= www.WinVistaClub.com =
Microsoft® MVP Awardee 2007-09.
Reply With Quote
  #3  
Old 26-01-2007, 06:57 PM
Tech Geek's Avatar
Tech Geek Tech Geek is offline
Wise Old Owl
 
Join Date: Sep 2006
Location: Cyber Hell
Posts: 1,495
Send a message via Yahoo to Tech Geek
Default Re: Tutorial : How to generate Folder/File Listing of a Directory?

nice tut
__________________
Behind every good computer... is a jumble of wires 'n stuff
Reply With Quote
  #4  
Old 26-01-2007, 07:35 PM
sridatta's Avatar
sridatta sridatta is offline
An Esoteric Geek
 
Join Date: Mar 2006
Location: Bangalore
Posts: 285
Send a message via Yahoo to sridatta
Default Re: Tutorial : How to generate Folder/File Listing of a Directory?

@techgeek thanks for the compliment
@AnandK
Thanks for the rep.
Actually i was referring to the hack given in ur link. But, the folder listing 'll only generate the list of the default folder that appears when we run cmd prompt. So, i made my own way just by referring to registry. This feature comes with a built-in tool in autopatcher. So, i uploaded the file and the corresponding registry settings.
Reply With Quote
  #5  
Old 29-01-2007, 09:45 AM
djmykey's Avatar
djmykey djmykey is offline
Let the music play.....
 
Join Date: Dec 2003
Location: Pune
Posts: 642
Send a message via Yahoo to djmykey
Default Re: Tutorial : How to generate Folder/File Listing of a Directory?

Ok first of all good tut.

But on second thoughts I wud give it a thot if I had to change any settings in the file types tab. I have had some really bad experiences before.

So a simple command line command to achieve the above task

cd to any folder whose listing you want and then

c:\> dir > c:\dir.txt
__________________
Long back, a person who sacrificed his sleep, forgot his family, forgot his food, fogot laughter were called "Saints"
But now they are called.."IT professionals"
Reply With Quote
  #6  
Old 29-01-2007, 02:22 PM
sridatta's Avatar
sridatta sridatta is offline
An Esoteric Geek
 
Join Date: Mar 2006
Location: Bangalore
Posts: 285
Send a message via Yahoo to sridatta
Default Re: Tutorial : How to generate Folder/File Listing of a Directory?

@djmykey

Thanks for the suggestion. I'll update my tutorial even giving details of registry keys stored so that ppl 'll never screw up editing the folder options...

The additional advantages you get by following my method is...

1. In no way, you can find the sizes of all FOLDERS present in a directory. Just try out even listing them in details view. Windows 'll only display the sizes of files but not of the folders.

2. Graphical Interface. Its pretty easy to use and we can generate the folder list just with a single right click.
Reply With Quote
  #7  
Old 29-01-2007, 06:20 PM
vinyas vinyas is offline
In The Zone
 
Join Date: Apr 2006
Posts: 399
Default Re: Tutorial : How to generate Folder/File Listing of a Directory?

Use a Freeware Directory Lister:

http://www.freedownloadscenter.com/U...ry_Lister.html
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump





Upcoming Events

Thinkdigit  
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.