Displays a list of the subfolders and files in a folder or drive with some information such as total file size, the last date and time each file was modified, and the amount of free disk space on the disk.
Navigate to the desired folder and type “DIR” followed by any desired switches. Does not show hidden or system files unless you use the /a switch.
/p: Displays one screen at a time. To continue, press any key on the keyboard.
/q: Displays the owner of each file, if applicable.
/a: Displays all files, including files with the hidden and system attributes.
/a followed by attribute codes: displays only files or other items with attributes you specify.
a: Files ready for archiving only
d: Folders only
h: Hidden files and folders only
r: Read-only files only
s: System files and folders only
Each of these codes can be inversed by preceding it with a minus sign (–). For example, –r displays only files with the read-only attribute. In addition, using multiple attribute codes, Windows will display only files with all of the attributes indicated by the codes. Don’t leave a space between codes when using multiple codes. For example, to display only files that are both read only and hidden, type:
DIR /arh
/s: Lists every occurrence, in the specified folder and all its subfolders, of the specified filename.
/x: Displays both long filenames and 8.3 filenames.
DIR has several more switches. Consult Windows’ Help or run DIR with the /? switch for more information.