Byothe.frTips and tricksHow to get or print the list of files in a folder

How to get or print the list of files in a folder

Article updated on September 15, 2025

If you've ever tried to get or print a list of files in a folder in Windows Explorer, you've probably noticed that Microsoft didn't provide this feature. There's no button in the classic Explorer that lets you do this easily.

It seems crazy… and yet, it doesn’t exist! But if I’m offering you this article, it’s because there is a relatively easy solution to do it and we’re going to see it together.

How to create a list of files in a folder

To achieve a satisfactory result and print the files and folders present in a folder, you will have to use MD-DOS and the Windows command prompt! Don't panic, it's not complicated... it's even very simple and it's one of the only ways to print the list of contents of a folder under Windows without installing a third-party application. The cherry on the cake is that this manipulation works with all versions of Windows!

A folder can contain various files, but also other folders. And sometimes it can be useful to list all the items in a folder. For example, let's say you want to list all your music by listing all the files present in your MP3 folder or you need to provide a list of documents as part of your work… Well, it is possible and it will allow you to list everything in a text file that you can print!

Get List of Files in a Folder with Windows Command Prompt

The first thing you need to do is open the command prompt in administrator mode. To do this, simply follow these steps:

  • search for “CMD” in Windows search (the magnifying glass at the bottom left or just the start menu)
  • right click on “Command Prompt”
  • select the “Run as administrator” option
  • the command prompt will then open
print list folder windows 1 | How to get or print the list of files in a folder
print list folder windows 2 | How to get or print the list of files in a folder

Once in the command prompt, type the following code:

chcp 1252

This little piece of code allows you to change the character set used by the command prompt and will ultimately allow you to have a list of files that are readable on computers Europeans.

print list folder windows 3 | How to get or print the list of files in a folder

The next step is to select the folder for which you want to create a list of files to print. In DOS, you use the CD command (Change Directory – change folder) to move through the folder tree.

So, to go to my C:\Users\grego\Desktop\blog folder I will have to type the following code:

CD C:\Users\grego\Desktop\blog

Fastoche!

The path will then be modified on the command prompt, I am indeed in my folder!

print list folder windows 4 | How to get or print the list of files in a folder

As the file that interests us has been selected, we will now ask MS-DOS to create a file that lists the files in my folder. To do this, type the following code:

dir>ma_liste.txt

In the code above, you can of course change the name of the file ("my_list") but you can also change the extension. The text format (txt) is the simplest, but it also works with the .doc format (for Word) or the .csv.

This command will then generate a file ma_liste.txt which will be saved in the folder you selected.

print list folder windows 5 | How to get or print the list of files in a folder
print list folder windows 6 | How to get or print the list of files in a folder

Open this newly created file and you will see the list of files and folders contained in your folder.

print list folder windows 7 | How to get or print the list of files in a folder

This file provides several levels of information and thus allows you to display the date and time of modification of each element present, its size in bytes and of course its name. In the case where the element is a folder, you will see the word displayed , For Directory, which can be translated as folder.

You can then do whatever you want with this file, including printing it… since that was what we were trying to do!

There are of course other ways to generate the list of files in a folder, but this is by far the easiest solution without installing any software.

Add Byothe.fr to my favorite Google sources
Byothe
Byothehttps://byothe.fr
As a forty-something dad fascinated by the web, I spend a lot of my time keeping watch to find you the best news. Tips and tricks, humor, websites and high-tech are the main subjects I want to cover here… but I will not fail to offer you good deals gleaned here and there on the web…

Related articles

2 COMMENTS

  1. Following your tutorial on this subject, here is what I observe When I type "chcp1252" after having pressed enter. it tells me: "chcp1252 is not recognized as an internal or external command, an executable program or a command file." Why?

LEAVE A COMMENT

Please enter your comment!
Please enter your name here


Discord

Want to chat live? Come and meet us on the Byothe.fr Discord server

Newsletter

Subscribe and receive a summary of web news every Monday

Latest news

Randomly