Printing List of Files in a Folder – The Command Line
The easiest way to print a list of files in a folder is using the command line. You can access the command line by clicking the Start button (the Windows Orb), clicking Run (if you do not see “Run" in your start menu, right-click the Windows Orb, select Properties, switch to the Start Menu tab, click Customize, scroll down and tick the “Run command" option), and typing cmd and hitting the Enter (Return) key.
In the command prompt screen, you will see the current working directory, which is something like C:\Documents and Settings\Your_User_Name. We will then switch to the directory that we want to retrieve the list of files. We will use the cd (change directory) command to navigate to the folder.
For example, suppose that we want to retrieve the list of files in the Downloads folder. To switch to the folder, we will simply issue cd Downloads command (tip: you can type the first or first two letters of the folder and hit the Tab key to autocomplete). To retrieve the list of files, simply issue the dir (directory) command and direct the output of the command to a text file. Following our example, the command will be dir /o > downloads.txt. Windows will list the files and subfolders in the Downloads directory, sort the list by directories first and then by name, write them in a text file and save the text file in the current working directory (which is Downloads in our case) with the downloads.txt name.
You can then double click and open the downloads.txt file. In my computer, the file is as follows:
(Click any image for a larger view.)