Friday, May 28, 2010

How Do I Do It: Generate File Listing Automatically

Do you ever encounter scenario like this?..

"...I have a folder. In the folder, it's contains 100 or more files. I want the list of files.."

Well, of course you can do it manually but that's gonna take a lot of your time and your energy. There's a simple way of course. Let me show you.

A. Basic ".bat" way
1. Open the directory you want to make list of files inside.
2. Right-click on any space there to make a new text document.
New --> Text Document
3. Open to edit the .txt file and put this into it(ignore quotes):
"dir /a /-p /o:gen >filelisting.txt"
4. Rename the .txt and change the extension to .bat. For example:
"genList.bat"
5. Then, double-click the newly created file and tadaaa. A file named "filelisting.txt will generated the inside will be a list of files inside the same directory where .bat file located.

Tips: If the generated list is to complex, too much information and you only want the filenames, edit the
"dir /a /-p /o:gen >filelisting.txt"
and change into...
"dir /a /b /-p /o:gen >filelisting.txt"



Now, lets move to the second one shall we?

B. Context file @ "rightclick --> generate" style
1. Like the above technique mentioned, create the batch file(follow 1-4 steps) but this time, move@place the batch file in the "WINDOWS" directory. For common windows users,that should be at: "C:\WINDOWS"
2. Open windows explorer or any windows(like My Computer,Documents), go to "Tools" --> "Folder Options" --> "File Types"
3. In the "Registered file types:" select "Folder" file type then click "Advance"
4. Make a new action by clicking "New". Specify the name of action(for example "Generate File Listing"). Then, click "Browse" and select the batch file created early in "WINDOWS" folder. Then, "OK" for all.
5. That's it. Now, whenever you want a list of files in directory, just select a folder, right-click it, and click on "Generate File Listing".


3152E8B06184DCAA296BA720E4BD41CB

No comments:

Post a Comment

Your comment is much appreciated. Thanks :)