List Files in Directory

From Relyimah

Jump to: navigation, search

Occasionally, I want to get a list of files in a directory for one reason or another. To do this, I do the following:

  1. Open Command Prompt
  2. Navigate to the directory you wish to get the list of files for
  3. Run the following command

Command Prompt:

DIR /W/A-D/B > files.txt


This will store the list of files in "files.txt" as below:

File Contents: files.txt

files.txt
text document (1).txt
text document (2).txt
text document (3).txt
text document (4).txt
text document (5).txt

As you can see, the "files.txt" file we sent the output to is also included in this list.

Personal tools