Need to know exactly what’s on a computer and want to look at it from a glance or a printed directory version? The command prompt (DOS CMD) has been existent since the beginning of Windows, so this groovy trick will work no matter if you’re using the latest Windows 7, Windows XP, or even Windows 98. The best part is that it auto-generates the entire list for you.
How To Automatically Create A Text Document Directory Listing Of Any Folder In Windows
1. Click the Windows Start Menu Orb and Type in cmd. Once the program link appears, Right-Click cmd.exe and Select Run as administrator.
2. In the command prompt that is displayed, Navigate to the correct folder you want. Navigation is relatively simple, just type “cd” (change directory) and then the local location of the folder on your computer. For example, if I wanted to go to c:Program Files, I would just Type:
cd c:program files
3. Once command prompt is at the folder you want a directory of Type in the following:
dir /s> Directory.txt
Tip: Add /b like in the screenshot below if you don’t need file details such as size, or date to be included.
A file named Directory.txt is created and placed in the same folder where you just queried a directory.
Inside of Directory.txt will be a complete list of every file within the queried location. In this example I have a HUGE list of every folder and file in c:program files and the list gets even bigger as it contains every content of every folder within every folder and each file in those. In this way, you can view every single file from any parent location in Windows in an organized and printable format.
The Tree Alternative
If you are more of a visual person, then the tree format may better suit your needs. This command works similar to the above one.
Just follow the above instructions, but at Step #3 rather than typing “dir /s> Directory.txt” instead Type:
tree> Tree.txt /A /F
The Tree Result
A Tree.txt file will be generated and placed in the same directory. This Tree format will display the same information as the other Directory, but it will be organized similarly to the way keys show up in the Windows Registry Editor. From here you can print or email the organized content list quickly. Groovy eh?
The Prompt (DOS) Commands Explained
|cd||Aka change directory, used for basic navigation in DOS.|
|dir||Displays all contents of the current directory|
|/s||When added after dir will display subdirectory contents|
|/b||Makes dir display only basic or “bare” file information|
|>||> Is an interjectory value that forces command output to an external file or location. Useful for any query.|
|tree||A graphic version of dir|
|/a||Provides ASCII graphics|
|/f||Makes tree display file names|
Questions, Thoughts? Post a comment below and check out the free groovyPost RSS feed for daily tech-related tips, how-to, and news.