How to Print the Contents of a Folder in Windows 10


Learn how you can print the contents of a folder then save it to a text file using the command line in Windows 10.

Printing the directory structure of a folder—including the filenames and subfolders—is one of those simple tasks that should be easy in Windows 10. The good news is that it iseasy once you know how to do it. You may also ask if you can print the entire contents of a folder. The good news is, yes.

However, it requires using the Command Prompt. But once you learn this simple command, you can quickly and easily generate file listings of folder contents that you can print or edit as you see fit.

First, we’ll show you how to print the contents of a folder using built-in Windows 10 functions. Then, we’ll show you an even easier way using some third-party software.

Print Contents of Folders Using the Command Prompt

If you want a printed listing of what’s inside a folder, here’s what you do.

  1. Open the Command Prompt.  To do that, click Start, type CMD, then right-click Run as administrator.
  2. Change the directory to the folder you want to print the contents of. To do that, use the cd command—for example, “cd c:\users\adacosta\documents”.
  3. Type the following command and hit Enter: dir > listing.txt

admin command prompt listing

This will generate a basic text file listing the contents of the directory.  The filename you save can be anything you want. You can call it listing.txt, files.txt, folder.txt, or whatever.

This is what it looks like:

Text file folder content

If you want to go a step further, you can print the contents of subfolders by issuing the following command: tree “c:\directory_name” > “c:\file_name.txt” /A /F

administrator command prompt

See example:

folder content example

There you have it, all the information you need about what’s stored in your folders.

Tip:On the command line, using “>” will always send the output of the command to a file. It works with any command. You can also use “>>” to append the output to the end of an existing file.

How to Use Karen’s Directory Printer

Looking for a graphical tool that can do the same thing? I would recommend Karen’s Directory Printer; I used it many years ago to generate print logs of files each week. It’s straightforward to use but features a jam-packed interface. All you need to do is select the direct directory, choose the attributes you want (file size, date created, extension) then click Print.

Karen's Directory Printer

Hopefully, Microsoft will make this a more easy task to perform. They have been known to surprise us in the past, such as updating apps like Paint and WordPad. Even the Command Prompt has gotten updates in recent times. Until then, this is the best you’ve got.



  1. Rene Poirier

    October 7, 2017 at 6:34 am

    I’ve been using “Shift + Right Click” from within a directory to open, in 1703, Windows Power Shell to do DIR.
    I had not used TREE before. It works there as well.

    Isn’t that easier than having to type the full path you want?

    Previous versions opened the Command window.

    It is not the Administrator level window. Does that make a difference if one is only looking to use these commands to print the directories?

    • D Lee

      July 14, 2019 at 2:47 pm

      MUCH easier!! Thank you for this shortcut. Otherwise, it is a time-suck navigating to the directory.
      Also, Dir/B >listing.txt is nice if you need just a list of files without size, date, etc.

    • james

      October 12, 2020 at 9:02 am

      Stupidly complex… no wonder everyone I know is moving to Mac

      • Johnny Mac

        April 3, 2022 at 6:13 am

        I was going to ask if you can do this on a Mac but then I decided to look it up. If you are switching to a Mac for something like this, go for it. But it definitely isn’t easier to do on a Mac. For example, if you want to print the file names in a particular folder in those 10, go to that folder and type CMD in the path box. Then enter dir /b > filename.txt. I text file will appear amongst the files in that folder and you can print it or edit it or do whatever you want with it.
        On a Mac you can print the file or save it as a pdf. If you want to edit it then you have to highlight the text on the PDF file, create a document, paste the text from that file into the document and then figure out where to save it. I’ll take the convoluted Windows method over the even more convoluted Mac method.

        • Niels

          September 19, 2022 at 12:45 am

          Well I have a Mac (next to a Windows laptop) and it IS easier (plus folders and files can be mixed while staying alphabetical)… just copy all files and folders and ‘Paste special’ then you have a full text copy to paste in a Text Editor and just save or print.

  2. James

    October 7, 2017 at 6:51 am

    Re Karenware

    If you agree to allow microsoft (chat line staff) to run the malware checker that goes with their ‘Assure’ sub then expect to be told that you have malware on your system as their checker considers the Karenware install to be suspect
    It may also cause you to get the Office installing panel show when you try to use it.

    But that seems to be associated with doing the installs and app startup the ‘microsoft way’ – their later upgrades to their facility start interacting badly with the earlier usage.

    Re the office app install – just let it run (usually after a win-10 update).
    Re the malware indication – DO NOT let Microsoft persuade you to pay for Assure on the basis that you have malware on your system – REQUIRE them to identify what malware they have determined to actually be RUNNING – and that they have REMOVED without killing off any of your APPS.

    And – the collection of Karenware facilities is AFAIK no longer supported – Karen being greatly missed by many.

  3. Ziggy

    October 8, 2017 at 3:33 am

    A very simple and portable tool to do this is File List Maker, version 1.3.0

    Tried this tool on Windows 10, 64 bit and worked a treat.

  4. Harris

    October 9, 2017 at 8:26 am

    My favourite is a small portable program – Snap2HTML – 448 kb. It makes a list of folders and subfolders which can be opened up to see the content. It works on Windows 10 x64. It’s great for making lists of what you have on a portable drive.

    • Ziggy

      October 9, 2017 at 5:45 pm

      @Harris: Just tried your suggested program and, I must say, it’s excellent. Thanks.

    • Andre

      October 10, 2017 at 11:50 am

      Gonna check it out. Thanks!

    • Jure

      July 22, 2019 at 10:23 am

      Thank you so much for this recommendation. Snap2HTML is absolutely fantastic!

    • Tony

      August 8, 2023 at 12:28 pm

      Snap2HTML looks perfect, thanks for the suggestion!!

  5. brian

    January 28, 2019 at 8:47 am

    Regarding “c:\directory_name” > “c:\file_name.txt” /A /F

    Shouldn’t /f be /d?

  6. NoName

    May 2, 2019 at 11:31 am

    This command does nothing. I think this is maybe out of date?

  7. Lon Bailey

    July 12, 2019 at 8:30 am

    Karen is gone now, but her spirit remains in Karen’s tools

  8. Jeff Fredericks

    August 19, 2019 at 12:13 am

    The command prints Cyrillic (Russian) script as “?”. Can you suggest a solution. Thanks

  9. Russ Brady

    November 19, 2019 at 5:14 pm

    I opened the command prompt as Administrator, went to the partition the directory was in, typed “dir”, highlighted the file listing, hit CTRL C, opened Notepad, put the cursor at the top of the blank page, hit CTRL V, the listing displayed, I saved the file on the desktop and sent it. No problems with “Access denied” I got when I followed the above instructions. Many times KISS works better.

  10. Eiger

    December 4, 2019 at 11:22 pm

    It would be helpful if you told us what the intended purpose of the /A and /F flags were.

  11. nina

    February 28, 2020 at 7:45 pm

    Windows 10 tells me tree is not recognized as an internal or external command. WTH?

  12. jamies

    March 1, 2020 at 11:58 am

    Tree is a ‘DOS’ command
    and it needs to be run within a command window
    it is not available as a command typed into the start (bottom left corner) of the windows window
    you need to type “command” without the quotes into that box and
    select the app – administrator mode may need right click on the app

    And – to avoid missing things you would probably want included in a report of files – definitely make that an administrator authorised level command window
    You can put dos commands in a txt type file with an extension of .bat or .cmd
    although the use of % is slightly different and you will almost certainly want a pause command at the end of the script

  13. DvdQ

    September 23, 2020 at 11:39 am

    Hello there, I have 135 folders with an unknow numbers of files. If I use this command I get information from 99 folders, about 2243 text lines; what happened with the others 46 folders? how many lines could managed this command?…Apologizes for my bad English.


  14. joey kaboey

    December 16, 2020 at 4:15 pm

    The Karen app is great – much easier than CMD route – and easily configurable, for example I wanted a list of files names only without any attributes, which worked easily. highly recommend!

  15. Dennis Dee

    January 25, 2023 at 11:28 am

    It used to be really easy to: go into the directory – SHIFT & RIGHT CLICK SELECT OPEN COMMAND WINDOW HERE – dir>filename.txt.

    Microsoft has an uncanny knack for making an operation they created to be so simple into a complex cluster BEEP!

Leave a Reply

Your email address will not be published. Required fields are marked *


To Top