Displaying All the Files in a Folder using the Command Prompt

by Barry Dysert
(last updated October 27, 2014)

3

You probably already know that you can navigate through folders and view their contents by using the Windows Explorer. Another way to display all the files a folder contains is by using the Command Prompt window. (Accessing the Command Prompt window is covered in this tip for Windows 7 users and this tip for Windows 8 users.)

At the command prompt, you can navigate through the folders and subfolders by using the CD command to change your current directory. Just follow the command by a space and the name of the directory you want to change to. If the directory name contains spaces, simply surround the directory name with quote marks, as shown in these examples:

CD "my files"
CD "c:/my data/word documents/budgeting"

After navigating to the directory using the CD command, you can see what files are contained in the directory by typing the DIR command at the command prompt.

 This tip (12033) applies to Windows 7 and 8.

Author Bio

Barry Dysert

Barry has been a computer professional for over 30 years, working in different positions such as technical team leader, project manager, and software developer.  He is currently a senior software engineer with an emphasis on developing custom applications under Microsoft Windows. ...

MORE FROM BARRY

Creating a System Restore Point

System restore points are created automatically at strategic times in the operation of your computer. You can also manually ...

Discover More

Understanding Remote Assistance

Sometimes you may need some computer help, or a friend may need help from you. By using Remote Assistance your computers can ...

Discover More

Changing Media Player Skins

Windows Media Player is a popular application used for audio applications. It can be customized to use different skins by ...

Discover More
More WindowsTips

Copying Files Using the Command Line

The copy command can be a timesaver over trying to do the similar sort of thing with Windows Explorer. You can copy hundreds ...

Discover More

Displaying the Command Prompt Window

You may have the need to perform repetitive operations or group several commands together to run as a batch. In such cases, ...

Discover More

Displaying the Command Prompt in Windows 8

Some commands require the use of the command prompt window. How you display that essential window in Windows 8 can be a bit ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 - 0?

2014-11-12 06:37:25

Maarten Daams

By redirecting your output to a file you can create a file containing the folder contents:

DIR C: > file.txt

Everything from the command before the pointy bracket will go to a text file


2014-10-27 08:24:51

Barry

Thanks for the caveat, Henry.


2014-10-27 08:18:21

Henry Noble

DIR alone will not display all of the files in a directory. To see the hidden and system files, append the switches /A:H and /A:S to the DIR command.


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.