How to Print or Save a List of Files in a Folder in Windows 10

To print a list of files in a folder in Windows 10, open the folder in File Explorer, click the address bar, type cmd, and press Enter. In the Command Prompt window, run dir /b > filelist.txt. The list is saved as filelist.txt in that folder. Open it in Notepad and select File > Print.

Applies to: Windows 10. Windows 10 reached end of support on October 14, 2025, and only PCs enrolled in Extended Security Updates still get security fixes, through October 12, 2027.

Save the list with Command Prompt

  1. Open File Explorer and go to the folder.
  2. Click in the address bar, type cmd, and press Enter. Command Prompt opens in that folder.
Windows 10 File Explorer with cmd typed in the address bar of a Contoso folder
Type cmd in the address bar (1) and press Enter.
  1. Run this command:

dir /b > filelist.txt

Windows 10 Command Prompt running dir /b to save a list of file names to filelist.txt
Run dir /b > filelist.txt (1).
  1. Go back to File Explorer and open filelist.txt.

You can change what’s in the list:

  • dir /b /a-d > filelist.txt lists files only, without folders.
  • dir /b /s > filelist.txt includes files in subfolders, with their full paths.
  • dir > filelist.txt adds sizes and dates.

The list can include filelist.txt itself. Delete that line, or save the list to your desktop instead:

dir /b > "%USERPROFILE%\Desktop\filelist.txt"

Copy the names without commands

  1. In File Explorer, press Ctrl + A to select everything in the folder.
  2. On the Home tab, select Copy path.
  3. Open Notepad and press Ctrl + V. Each line shows a file’s full path in quotes.

Print the list

  1. Open filelist.txt in Notepad.
  2. Select File > Print, or press Ctrl + P.
  3. Pick your printer and select Print. Margins, paper size, and other options are under printer settings in Windows 10.

List only certain files, in order

  • dir /b *.pdf > pdfs.txt lists only PDF files. Change *.pdf to any extension, such as *.jpg.
  • dir /b /o:n > filelist.txt sorts by name.
  • dir /b /o:-d > filelist.txt sorts by date, newest first.
  • dir /o:-s > filelist.txt sorts by size, largest first, and includes the sizes.

Get the list into Excel with sizes and dates

Excel can read a whole folder without any commands. In Excel, select Data > Get Data > From File > From Folder, choose the folder, and select Load. Excel creates a table with each file’s name, extension, dates, and folder path, including subfolders. Select Refresh on the Data tab later to update it.

Show the folder structure as a tree

To see subfolders and the files in them laid out like a family tree, run tree /f > tree.txt in the same Command Prompt window. Leave out /f to show only folders. Add /a if the lines look garbled when you print, which switches to plain characters.

Export a detailed list with PowerShell

For a spreadsheet-ready list with sizes and dates, open the folder, type powershell in the address bar, and press Enter. Then run:

Get-ChildItem -Recurse -File | Select-Object Name, Length, LastWriteTime, DirectoryName | Export-Csv filelist.csv -NoTypeInformation

This saves filelist.csv in the folder with one row per file, including files in subfolders. Double-click it to open in Excel, where Length is the size in bytes. Leave out -Recurse to list only the top folder, or add -Filter *.pdf after -File to list one type.

Print a small folder as a picture

If the folder only has a few dozen items and you want it to look exactly like File Explorer, switch to View > Details, then press Windows + Shift + S and drag around the file list. Paste the screenshot into Paint or Word with Ctrl + V and print it from there. For longer lists, the text or CSV methods above are easier to read and search.

If the list doesn’t come out right

  • “Access is denied.” You can’t write a file in some protected folders, such as Program Files. Save the list to your desktop with the command shown above.
  • Accented letters look like symbols. Run chcp 65001 first, then the dir command again. Notepad will then show names with accents or other alphabets correctly.
  • Hidden files are missing. Add /a to the command, for example dir /b /a > filelist.txt.
  • The address bar trick opens a web search. Make sure you replaced the whole folder path with cmd before pressing Enter.

Frequently asked questions

Can I do this with PowerShell?

Yes. In the folder, run Get-ChildItem -Name | Out-File filelist.txt.

Why are some files missing from the list?

dir skips hidden files. Add /a to include them, like dir /b /a > filelist.txt. To see them in File Explorer too, show hidden files and folders.

How do I open Command Prompt another way?

You can open Command Prompt from the Start menu or several other places. Use cd to go to the folder first.

How do I copy just the file names, without the full path?

Use dir /b > filelist.txt as shown above, which lists names only. Copy path in File Explorer always includes the folder.

How can I count the files in a folder?

Open the folder and press Ctrl + A. The bar at the bottom of File Explorer shows how many items are selected. For a folder and all its subfolders, right-click it and select Properties to see the total number of files and folders.

Is there a Print button for folders?

No. Windows 10 can’t print a folder’s contents directly, which is why the steps above save the list to a text file first.

Does this work in Windows 11?

Yes. The commands are the same. In Windows 11 File Explorer, right-click the selected files and choose Copy as path instead of using the Home tab.

Every switch for these commands is listed in dir and Out-File.