I recently had to send a friend a list of all files and folders in a specific directory on my computer and it took me a while to come up with a better way to do this. After playing around with various methods, I was able to create a beautiful Excel spreadsheet with all the file and folder data as well as additional information like file size, last modified date, etc.
In this article, I’m going to mention two main ways to create a directory listing: using the command line or using a third party program. If your needs are very simple, the command line method is the simplest and doesn’t require any additional tools. If you want a more trendy report, check out the free utilities.
So let’s start with the command line method first, as it’s easy and will probably be enough for 90% of the people reading this article. To get started, open File Explorer and navigate to the folder directory above the folder for which you want to list directories.
If you want to print a list of files and folders for C: Test MyTestFolder, navigate to C: Test, press SHIFT and then right-click MyTestFolder. Go ahead and choose Open Command Window from the menu.
On the command line, you must enter a very simple command:
The dir command generates a list of files and folders in the current directory, and the right angle bracket tells you to send output to a file and not to the screen. The file will be created in the current folder, and if you open it with Notepad, it will look like this:
By default, the command will give you the last modified date / time, file size, directory listing, and actual file names. If you need other information, you can add parameters to the command.
For example, if you don’t need all this additional information, you can print only the file and folder names using the following command:
dir / b> filename.txt
In the examples above, you will notice that there is a folder named Word Stuff, but the output does not list the files inside that directory. If you want to get a list of all files and folders, including subdirectories of the current directory, you must use this command:
dir / b / s> filename.txt
Note that you can also get rid of / b if you want a complete listing of directories and subdirectories with additional size information, etc. Here is the dir / s> filename.txt output below.
The dir command has many other command line options that I won’t mention here, but you can check out the full list of them on the Microsoft website. Using advanced options, you can also show file attributes (hidden, compressed, etc.), Show file ownership, and more. Then you can import the data into Excel and choose tab-delimited so that the data is split into separate columns rather than grouped into one.
Free third-party program
Directory listing and printing
List directory and print
One of the best utilities for printing directory lists is Directory List & Print When you download it, you will notice that some features are disabled. This is because the free version does not include all the options that the Pro version has. To unlock everything, you have to pay $ 20.
However, if you really don’t need to print out directory listings on a daily basis, the free version will be more than sufficient for almost everyone. After installing it, you must first select the directory you want to print. You can also choose from the favorites list on the right.
Please note that at this stage you should see the preview result in the lower text window of the program. I really like this because you can play around with different parameters and see updated results instantly. Now click on the second tab titled “Selection”.
By default, the Provide Subdirectories and Provide Files check boxes are selected. This means that it will print a list of files in the current directory and include all folders in the current directory as well. It will not list files that are in subdirectories. If you want to do this, check the “Run in subdirectories” box at the bottom.
As you can see, you can specify creation date, modified date, file size, path, etc. In the free version, but if you need the file owner, file attributes, etc., you will need to unlock the software. In the example below, I selected the Show File Size and Run Through Subdirectories checkboxes to get this result:
I will skip the third tab (Filter) because it is completely disabled in the free version. The paid version has some pretty advanced filtering options, but they’re really only needed if you have thousands or millions of files. On the Output tab, you can choose where you want to export the listing.
You can print it, copy it to the clipboard, or export it to Word and Excel. To annoy them, they turned off copy to Notepad and export to file in the free version. The Action tab is also completely disabled, so we won’t go into details here. In general, the free version of the program does its job well and is more than enough to get a complete and detailed catalog listing.
Karen Catalog Printer
Karen’s Guide Printer
Karen’s directory printer is quite old (2009) but still does a great job of exporting directory lists. It doesn’t have as many options as Directory List and Print Pro, but compared to the free version, it’s pretty close.
First you have to select the Print or Save to Disk tab. Both are exactly the same: one just prints to the printer and the other saves the output to disk. It most likely didn’t require two separate tabs, but this is an old program.
Select a folder and choose whether you want to print only filenames, only folder names, or both. You can also tell it to look for subfolders and print them. In addition, you can include or exclude system, hidden and read-only files.
Checking the Show Network box will allow you to see all network drives and shares and print their structure. also! This is great for office networks that have shared folders on servers.
You can also sort files by name, extension, file size, creation date, modified date, etc. You can also set a file filter so that only certain file types are printed, such once images, sound files, executables, documents, etc.
Finally, you can choose from a large number of attributes, which you want to include in the print file list. By default, it has a few checked items that I’m not interested in, like attributes, last accessed date, etc. Just uncheck them and be sure to click on the Folder Info tab and do the same there.
When you save the file to disk, the program inserts a bunch of useless comments, which, luckily, can be removed by checking the “Skip comment lines” checkbox. You can also get rid of the column that shows if the row is a file or folder by checking the second checkbox.
Finally, another great feature of the program is that it adds an option to the explorer context menu so that you can just right-click any folder and select “Printing with DirPrn”.
There really is nothing else in the software other than what I showed above. It works great on Windows 7 and Windows 8, so that’s great.
So these are all different ways you can create a directory listing for free with as much or as little information as needed. If you have any questions, please leave a comment. Enjoy!