Helping people with computers... one answer at a time.

There is as yet no Windows included application or option to print a listing of the contents of a folder or drive. I'll look at how else we can do it.

Windows 7 Starter: How can I print directories of the various USB Drives showing folders and files? My old program of PowerDesk was a beauty but not for Windows 7.

You know, after all this time I'm actually surprised that a better solution for this isn't already part of Windows. It's a common request that predates Windows 7.

As you've seen a solution is often to use some third party program to do it.

And that may still be perhaps the best solution.

But I'll also show you what you can do without any additional software in Windows.

Command Prompt: Free With Every Windows

Perhaps the quickest way to get a listing of any folder - be it on your hard disk or your external USB drive - is to use the Windows Command Prompt, available in every edition of Windows.

Typically you'll find it in the Start menu, Accessories sub-menu as Command Prompt.

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\LeoN>

As you can see when we start the command prompt it opens with C: as the "current drive", and \Users\LeoN as what's called the "current directory" or folder.

The first step is to change that to be the drive or folder whose contents you want to print. I'll use a USB drive placed in I: as my example.

C:\Users\LeoN>i:

I:\>

I typed in "i:" (without the quotes) and pressed enter. That tells the command prompt to make I: the current drive. The root folder of I:, "\" is by default the current folder.

The DIR command, for directory is used to get a listing of the files in the current folder:

I:\>DIR
 Volume in drive I is 2GB FLASH
 Volume Serial Number is E075-5E64

 Directory of I:\

01/27/2011 11:52 PM 1,208,545 IMAG0105.jpg
01/27/2011 11:52 PM 1,254,398 IMAG0106.jpg
01/27/2011 11:53 PM 1,031,069 IMAG0107.jpg
02/03/2011 03:54 PM 1,167,102 IMAG0108.jpg
02/03/2011 03:55 PM 1,286,579 IMAG0109.jpg
               5 File(s) 5,947,693 bytes
               0 Dir(s) 2,102,657,024 bytes free

I:\>

You could, of course, copy/paste that somewhere, or perhaps even use Print Screen to get an image, but there's a better way:

I:\>DIR >c:\t\directory.txt

I:\>

This time the output of the DIR command was "redirected" using the ">" operator, placing it into a file called "c:\t\directory.txt" - in otherwise a file "directory.txt" in the "\t" folder on the "c:" drive.

That's a plain text file, and thus we can open it in notepad:

Directory listing in Notepad

And of course Notepad has a File Print option.

Command Prompt and Longer Listings

In the example above I have only one folder, and only six files.

To get a longer listing we might do things just a little differently.

I:\>CD /d c:\windows\system32

c:\Windows\System32>

The CD command tells the Command Prompt to change the current directory, and the "/d" option tells it to change the current drive at the same time in a single command. We've changed to Windows' system32 folder; we'll find lots of files and folders there.

c:\Windows\System32>DIR /b /s >c:\t\directory2.txt

c:\Windows\System32>

Again the DIR command gets us our directory listing, but there are options specified: "/b" meaning "bare" - only the filename will be listed, and "/s" meaning "subdirectories" - in addition to listing the files in the folder, all subfolders and all files in the subfolders will be listed.

This is a pretty long list, so it's redirected to c:\t\directory2.txt, which we can once again open in notepad:

Long Directory Listing in Notepad

That's a list of 13,572 files, which printed to 297 pages.

The DIR command has a number of additional options for the information it displays - just type DIR /? to get a list.

Karen's Directory Printer

Not unsurprisingly there are several third-party solutions to printing the contents of folders as well. One of the most popular is Karen Kenworthy's Directory Printer.

KarenWare Directory Printer

As you can see it has a wide range of options for printing (or saving to disk) the list of files and/or folders on your USB drive or any other drive you might want to record.

And it's free.

Article C4732 - February 4, 2011 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

16 Comments
Mike
February 5, 2011 1:40 AM

For a short list, there's also the option of
dir > prn or dir > lpt1, followed by echo (Ctrl-L) > prn to generate a formfeed and kick it out of the printer.

Mark Jacobs
February 5, 2011 3:35 AM

My personal favorite Total Commander. I does that and that's only about 2% of what it does. (A few things it does: 2 Panel Windows Explorer replacement, Program launcher, Multiple file renamer, FTP client, file finder, zip and rar your files, file viewer and more) It's free to try, with no time limit but with a nag screen until you buy it. IMHO the best $42 you'll ever spend on a program. www.ghisler.com . Warning: once you get hooked you'll never be happy using Windows Explorer again.

Duane Welch
February 8, 2011 8:50 AM

As an "old" DOS person who grew up with personal computers when everything was DOS, your solution was something we did all the time. How about the "xcopy" command in a batch file for updating files to another location? There are lots of things which can be done with the "old" DOS commands, some of which are not possible with the graphical interface. Perhaps a reference tool for learning more about those "old" DOS commands would do some good.

duane

Surry Roger
February 8, 2011 8:53 AM

WOW! Too technical for average user. Try this: Open your Word, or Open office Writer, or other writer program. Then plug in your flash drive, and at the prompt ' What do you want Windows to do?' select ' open folder to view files'. This should show you what is on the drive. Press the print screen key on your keyboard. (this should put a copy on your clip board) then go to your word document and right click and paste.
For really cool, download Gadwin Print Screen and install (free version). Then you can print, and make files of anything you see on your screen, even your desktop. You can change the part of the screen you select if you go to 'Preferences' and select 'rectangular area', along with other features.
Note: If you have turned off auto run, for USB devices, you will have to go to START/MY COMPUTER/ X (where X is the address of the USB drive). Then press print screen, etc.

I avoided Print Screen based solutions because they only work if the list of files actually fits on the screen. If you have a lot of files on the device it gets really messy really quick.
Leo
08-Feb-2011

hzm1016
February 8, 2011 8:58 AM

Once you have made the leap to using the command prompt, I like to use the "attrib" command for this purpose. It gets you full pathnames, and gives them to you one per line.

This is especially helpful if you use the "/s" option to display an entire directory subtree. Unlike "dir /s", "attrib /s" displays the full pathname and so you will not have to find the matching name, then scan upward for the directory name. It also lists all files, including system and hidden files, unlike the default for the dir command.

The one thing to note is that "attrib /s" does NOT display the names of subdirectories by default, but you just need to use "attrib /s /d" to see files and subdirectories.

As with the examples in the article, you can direct the output into a file. Sometimes I find it helpful to sort the list, which will group the files with the same attributes together:

attrib /s | sort >Pathnames.txt

If you have some form of GNU-tools-for-Windows (I use an ancient Cygwin tool kit) you can use "sed" to reduce it to pathnames alone (stripping off the lefthand columns of attributes) and then sort them:

attrib /s /d | sed "s/.*\(.\):/\1:/" | sort >SortedNamesOnly.txt

Andrey Zharkikh
February 8, 2011 1:58 PM

A better way, I think, to use a browser (Firefox, not IE, because the latter knows too much about what you "need"):
type "file:///C:/" as URL address. Then you can browse subdirectories and print any content seen on the screen.

A nice approach I hadn't considered. Thanks!
Leo
08-Feb-2011

Black Dahlia
February 8, 2011 4:13 PM

Andrey's solution works in Chrome, too, by just typing "C:".

S G Kris
February 8, 2011 4:47 PM

I have been using 'PrintFolders' for many years to save or to print out the list of contents of any folder. One can select the whole drive to be listed, if needed. Can be be customized to include sub-folders, full file path etc. Output could be a text or html file. Very handy to print out the contents of a music disk/ folder. Freeware and less the 0.5 MB.
There is a shareware (which I have not tried)with similar name. Look for one by Author: Roman A. Pivararov . PCWorld.com has it.
Hope this helps.

Navin Patel
February 8, 2011 8:03 PM

Hi Leo:

This is a very useful tool. I love it. So far I was using Karen's Directory Print and that works just fine also. In that case you do not need to remember all these dos commands.

Thank you very much for such very important tips.

Navin Patel

Loren Barrett
February 8, 2011 8:33 PM

I have used Karen's Directory Printer for years. She has some super programs at the right price!
I print contents of CDs/DVDs as an index to put with the disk.

James
February 10, 2011 3:51 AM

Andrey's solution also works in Opera (my preferred browser), again, by just typing "C:".

Glenn P.
February 10, 2011 4:55 AM

Try it in Internet Explorer v8. :)

Sam77
February 10, 2011 7:25 AM

What surprises me most about the question is that this person can't use PowerDesk on Windows 7. As I type, I'm on a Windows 7 computer, and PowerDesk seems to work fine on my computer, including the feature to "Copy (selected file) Name(s) as Text," which can then be pasted to Word, Notepad, etc. To be sure, I tested this just before posting this comment (PowerDesk Pro, v.6),

That said though, I'm happy to read of so many other convenient solutions to this issue.

Sam77
February 11, 2011 7:54 AM

After my post yesterday, I tried Karen's "Directory Printer," and found it very "information overload." Then I found another filename program called "CopyFilename." VERY light-weight, and does what PowerDesk does: Copies the list of selected files - and only the file NAMES - as though you were copying text, then you just paste it to any document and can print from there. Very neat, clean, and simple - it works in Explorer, via the "right-click" context menu.
The website is http://www.extrabit.com/copyfilenames/
I suspect this is what most people want when they think of printing a list of filenames.

Duane Ferguson
February 11, 2011 2:09 PM

Tree Size Free gives you a comprehensive list of directories and files on any drive, and is extremely useful for locating large files devouring your hard drive space. I've used it on client servers to show that backups were failing because staff had stored entire seasons of their favorite TV show on a company server. I've also used it to tidy up our machines at home.
http://www.jam-software.com/treesize_free/

Allan
June 16, 2011 10:35 AM

Try Directory Report
http://www.file-utilities.com
It can print many file attributes in many formats

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to http://askleo.com/ask to ask your question.