Dir
Displays a list of directory files and subdirectories.
dir attributes]]sortorder]] timefield]]
Parameters
None
If used without parameters or switches, dir displays the volume label and serial number of the disk, followed by a list of directories and files on the disk, including their names and the most recent modification date and time. dir can display the file extension as well as the file size in bytes. Dir also displays the total number of files and directories listed, the cumulative size, and the available space remaining on the disk (in bytes).
Specifies the drive and directory to view the list of.
Specifies a specific file or group of files to view the list of. Multiple filenames can be used. Filenames can be separated by spaces, commas, or semicolons. Wildcard characters (? and *) can be used in the filename parameter to display a group of files.
/p
Displays one screen of the list at a time. Press any key on the keyboard to view the next screen.
/w
Displays the list in wide format, showing up to 5 filenames or directory names per line.
/d
Same as /w, but files are sorted in columns.
/aattributes]
Displays only the names of directories and files with the specified attributes. If this switch is omitted, dir displays all filenames except hidden and system files. If this switch is used without specifying attributes, dir displays the names of all files, including hidden and system files. The following list describes each value that can be used for attributes. The colon (:) is optional. Use combinations of these values and do not separate them with spaces.
Value Description
h Hidden files
s System files
d Directories
a Archiveable files (backups)
r Read-only files
-h Non-hidden files
-s Files other than system files
-d Only files (not directories)
-a Files that have not been changed since the last backup
-r Non-read-only files
/o sortorder]
Controls the order in which dir sorts and displays directory names and filenames. If this switch is omitted, dir displays names in the order they appear in the directory. If this switch is used without specifying sortorder, dir displays directory names in alphabetical order, followed by filenames in alphabetical order. The colon (:) is optional. The following list describes each value that can be used for sortorder. Use combinations of these values and do not separate them with spaces.
Value Description
n Alphabetical order by name
e Alphabetical order by extension
d By date and time, earliest first.
s By size, smallest first
g Directories grouped before files
-n Reverse alphabetical order by name (from Z to A)
-e Reverse alphabetical order by extension (from .ZZZ to .AAA)
-d By date and time, latest first
-s By size, largest first
-g Directories grouped after files
t timefield]
The following list describes each value that can be used for timefield. Controls the time field to display or use for sorting.
Value Description
c Creation
a Last access
w Last write
/s Lists each specified filename that appears in the specified directory and all subdirectories.
/b Lists each directory name or filename, one per line (including the file extension). This switch does not display header information or summary. /b overrides the /w switch.
/l Displays unsorted directory names and filenames in lowercase letters. This switch does not convert extended characters to lowercase.
/n Displays the long list format with filenames on the far right.
/x Displays the short names generated by files on NTFS and FAT volumes. Displays the same as the /n switch, but short names are displayed after long names.
/c Displays multiple separators by file size.
For more information, click Tree in the "Related Topics" list.
Tree
Graphically displays the directory structure of a path or drive's disk.
tree
Parameters
drive:
Specifies the drive containing the disk whose directory structure you want to display.
path
Specifies the directory whose directory structure you want to display.
/f
Displays the filenames in each directory.
/a
Specifies that tree uses text characters instead of graphic characters to display the lines that link subdirectories.