Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a utility that will generate a list of all file-names of a particular type in a given folder, and allow that list to be printed?

Windows search fulfills my UI wish-list but the search output can not be printed.

This may be done to some extent using a shell-script.

for /r %f in (*.*) do echo %~nF >> report.txt

The output listing however is not necessarily alphabetical. More importantly the search filter file-type must be changed through the console. The reason I'm looking for a UI as well is that the facility may be used by others in my family who are a lot less tech-savvy than I; people for whom just bring up the console is significant effort.

In a nut-shell I'm looking for an application that will:

  • List all files of a given type at a given location

  • Allow the listing to be sorted visually

  • Print the listing as it is rendered

share|improve this question
up vote 2 down vote accepted

As you said, you could do it using a shell script. You can sort by using the dir command instead of a for command, though. The files can be listed alphabetically, using /ON, or you can choose to sort by some other factor (such as time created). To specify the filetype, you simply list the extensions at the end with a wildcard for the filename. For instance, to list all the files of type txt alphabetically sorted, you would type dir /ON *.txt. There are other options, as well, such as filtering by file attribute. You can read up on them by using dir /?.

I found this Microsoft Knowledgebase article which describes how to add a "Print Directory Listing" option to a folder's right-click menu. I tried it on my laptop and it seems to work. You can read it here, and download their tool to set it up automatically (or get the instructions to do it manually, yourself):

share|improve this answer
Yep. I'd prefer to keep the shell script as a last option because my elders will be using the facility too. A decent UI would make it easier for them, and free me from having to be at hand to supervise/assist. Windows console will work for me, but it'll require more effort from them – Everyone Aug 16 '11 at 17:43
I know of no way to do this natively in Windows via a GUI (in fact I recall this being one thing Mac users would miss in Windows). However, I do believe there are third party options available. This would have to be something I'd need to look up. – Ben Richards Aug 16 '11 at 17:59
@Everyone I edited my answer to include another option that may be useful for you. – Ben Richards Aug 18 '11 at 2:42

You might want to try running this from a prompt window:

dir/a/b/s *.txt > filelist.txt

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .