Print the Contents of Any Windows 7 Folder

Posted on May 13, 2010 at 5:35 am

Since Windows 95, there has been a missing feature in the operating system that frustrates many users. Microsoft has never given us an easy way to print the contents of a folder. There are several workarounds to this problem but some solutions are easier than others are.

Why Print Folder Contents?

Any folder in Windows 7 can contain a collection of files or other folders. In fact, the folder structure of the Windows operating system is quite a complicated menagerie of files and folders. Printing the contents of personal folders such as My Documents has several useful applications.

First, printing folder contents lets you keep a hard copy record of all of your files and folders in any folder you choose. This is especially useful if you take a snapshot of the contents of your Program Files folder. This way, you have a record of the applications you had installed on your computer in the event of a hard drive or operating system crash.

Second, if you often find yourself having to edit many documents in a folder, having a printout of the contents of the folder allows you to check off the files you’ve edited and make brief notes to yourself about the editing you’ve completed. This is especially useful for students and copyeditors who must make minor adjustments to many documents at a time.

Finally, printing folder contents can help administrators compare the contents of an infected folder with the contents of a healthy folder. Many viruses and other malware add or delete files and folders to do whatever it is they are doing to your computer. By comparing copies of the contents of two folders, an administrator can easily check whether everything that should be in the folder is indeed there.

Printing Folder Contents with Screenshots

One popular method of printing folder contents in Windows is to take a screenshot and print the resulting picture using a graphics program. This is inconvenient for two reasons. First, you have to paste the picture into a graphics program. If you don’t have a graphics program, you are stuck using MS Paint or some other underpowered application. Second, the image quality from such a screen capture is usually quite low. The actual printout you get may be grainy, too small, or go beyond the limits of how far your printer can print to the edges of the paper.

Print the Contents of Folder in Windows 7

Luckily, there is another way to print the contents of any folder in Windows 7. However, there are a number of steps involved to get a nice, clear printout of your folders. Begin by logging in to Windows 7 with an account that has administrative privileges. Click on Start>All Programs>Accessories and locate the application titled Command Prompt. Right click on Command Prompt and select Run As Administrator from the menu.

Windows 7 Command Prompt Run as Administrator

Windows 7 asks you if you indeed want to Run the Command Prompt as an administrator. Click Yes and the Command Prompt will open. Navigate to the location of the folder whose contents you want to print. In this example, we will print the contents of the Program Files folder. To get there, type the following and press the Enter key:

cd\program files

Now you need to clear the Command Prompt screen. The clear the screen, type the following and press the Enter key:

cls

Your Command Prompt display should now look like this:

Clear the Command Prompt Screen

Now type the following into the Command Prompt:

dir> contents.txt

Windows 7 won’t give you any indication that anything has happened. However, if you navigate to the Program Files folder using Windows Explorer, you will notice a text file there named “contents.txt” in the folder.

A New File in the Program Files Folder

Open the file and you now have a complete and detailed list of all the files and folders within the Program Files folder.

Text File with Folder Contents

Of course, this trick works with any folder. Just remember that the file you create that contains a list of the folder’s contents will always be saved in the folder you are trying to print.

Also, you can name the file anything you want and you can give it any file extension. If you prefer, you could name the file “Program Files Contents.doc” so you have a more descriptive name and can open the file up directly into Microsoft Word.

» Filed Under Windows 7

Related Posts

Comments

11 Responses to “Print the Contents of Any Windows 7 Folder”

  1. Jason said on :

    Why not use the Win7 search off the orb? Just type in CMD and hit enter, the DOS/Terminal window will open.

    Also, what does it matter about clearing the screen? The data that you want is generated by the command “dir> contents.txt”.

    Don’t forget to close the command line window by clicking on the X in the upper right or typing “exit” in the command line window and pressing enter.


  2. Nick said on :

    I really like this and was wondering if there was a way to do the following.

    Navigate in explorer to th folder I want to print the contents of, Shift+Right Click and select “Open Command Window Here” and NOT get the “Access is denied” error when I do the dir> contents.txt command? Basically, is there a way to access an admin level command prompt from the “Open Command Window Here” option? I’ve tried changing the advanced properties of cmd.exe to “Run as administrator”,b but no luck. Thanks!


  3. Nick said on :

    Nevermind, you just Alt+Shift+Right click :0)


  4. Randall said on :

    I like how clean this is. I know how to print a .txt file of any name of any folder and its subfolders, but I like how this command does require spelling out the destination of the .txt file, nor which folder should be printed.

    Question: With this command, is there a way to print subfolders?


  5. Randall said on :

    The command I usually use is “dir d:\ /s >c:\filelist.txt”.

    The first drive represents what I want printed. The /s switch tells it to include subfolders. The second drive represents where I want the text file printed to and what I want it named.


  6. J. L. said on :

    Thanks for the useful tip! Made a batch file successfully with it.


  7. Sid said on :

    Yes. And if you wish to just have the list of file names (no timestamps and the s), you can do a dir /B >contents.txt The /B flag lists the file names and nothing else.


  8. Doc said on :

    For most purposes, I find that DIR with the /B switch (long filenames only) works best. Also, you don’t need to run the Command Prompt in Administrator mode if you have read/write permissions for the folder in question (for example, the current user’s “My Documents” or its subfolders.


  9. LXB said on :

    This obviously doesn’t work on Windows 7 and DFS shares. Any other hints?


  10. LXB said on :

    Correction: Works only if the statements are placed in a batch file and executed! Strange, but works.

    Cheers,
    LX


  11. Evelyn said on :

    Thank you so much! This is a wonderful shortcut. I love tips that are actually short and doable, and yours is. :-)


Please post your comments/suggestions!