Displaying All the Files in a Folder using the Command Prompt

Written by Barry Dysert (last updated April 19, 2021)

2

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.)

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, 8, and 10.

Author Bio

Barry Dysert

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." ...

MORE FROM BARRY

Regaining Control of Your System

The Windows Task Manager is a useful utility that provides information about what's running on your system. You can also ...

Discover More

Changing the Size of the Taskbar

The Taskbar is the "heart" of managing your work in Windows. Fortunately, it can be sized to your heart's content. This ...

Discover More

KeePass Password Safe

If you feel overwhelmed by the number of usernames and passwords you have to remember, KeePass Password Safe is your ...

Discover More
More WindowsTips

Changing Font Size in a Command Prompt Window

If you work at the command level very much, you may want to change the fonts that are used. You can control what ...

Discover More

Quickly Finding Your IP Address

IP addresses identify your device on IP-governed networks. If you need to find your IP address quickly, you can use the ...

Discover More

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 ...

Discover More
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}] (all 7 characters, in the sequence shown) 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 one minus 0?

2021-06-28 08:07:47

Len Richards

You always leave out some way to do something ... it is because you don't know about it

DIR /B "MY FILES" ==== DISPLAYS THE FILES

no need for your long version of doing something then using cd command to get somewhere else ... c'mon man, do some learning about Windows


2021-04-19 15:42:27

Tomek

@Barry: You forgot to mention that you have to make sure that the directory you want is on the current drive.
If you issue a command "cd E:\MyFiles" but you current drive is C:, the command "dir" will still show files from current directory od drive C:.


Newest Tips