Displaying All the Files in a Folder using the Command Prompt

by Barry Dysert
(last updated November 6, 2017)

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

Removing a File Type Program Association

Removing a file type program association is a task for third-party utilities. You can, however, change the association ...

Discover More

Agent Ransack

If you need to search the contents of files fast, Agent Ransack is a tool worth having. It searches through multiple ...

Discover More

Using the SHIFT Statement

Sometimes your batch file needs to accept an unknown number of parameters. This is easy to deal with if you know about ...

Discover More
More WindowsTips

Switching Between Command Line and File Explorer

Sometimes you can be more effective in a command window, and other times you can be more effective using File Explorer. ...

Discover More

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

Renaming Files Using the Command Line

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

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 five minus 4?

2017-11-06 18:55:49

Hawkmeister

dir /ah will display all files in the current folder/directory EVEN 'hidden' files.


2017-11-06 10:25:10

Henry Noble

There are several options (switches) for the DIR command. Among the more useful:

DIR /P Pauses after each screenful of data when the list is long

DIR /O Sorts the list with directories before files

Switches can be combined. For example: DIR /O /P

DIR /? Displays the help file for 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.