Learn how to quickly make a printable list of files in a folder (and how to import it into Excel)

Sometimes I need to get a list of files or folders inside another folder in Windows. I like to either print the results or take them to Excel to work on them. However, it isn’t self evident how to do this – there’s no print command in Windows Explorer that can do it for you. However, once you know how to do it, it’s easy to do.

Start by navigating to the folder whose contents you want to print. You want to have this folder visible in the right hand pane in Windows Explorer. Hold the Shift key as you right click this folder. A shortcut menu will appear, from it choose the Open Command Window here option.

This opens a MSDOS window inside the folder.

Now type this DOS command at the prompt and press Enter:

dir > filelist.txt

The name filelist.txt can really be any file name of your choice, I just like to use the .txt extension since its contents are plain text.

When the prompt reappears close the window.

If you now look inside this folder you will see a text file called filelist.txt. You can now print it by right clicking it and choose Print or double click to open it in Notepad and print it from there.

 

You can also open it in Excel and convert it to columns of text using the Text Import Wizard. The file is a fixed width file so it converts pretty easily into columns of text – you simply need to drag the lines in the preview to mark out how the text will convert to columns.


Then, when you are done, click Finish and you have the data in Excel – save it as an .xlsx file and you’re good to go.