DIR

RECENT NEWS

12/18/2015 - Hello! We're excited to announce that Mental Works Computing Software will soon be featuring

12/11/2015 - We're going to announce Dr.Batcher 3.0 Alpha with batch files debugger support soon. If you want to start...

News history...

TESTIMONIALS

Rob van der Woude:
"Mental Works Computing Software has created a nice tool for...

Andrew Jaritsyn:
“I used to write batch files with the help of Notepad, but...

Steve H.:
“This tool helped me to write some batch files in a couple...

More...

DIR

Lists files and subdirectories in the given directory.

Syntax:

DIR [Drive:][Path][FileName] [...] [/p] [/q] [/w] [/d] [/a[[:]Attributes]][/o[[:]SortOrder]] [/t[[:]TimeField]] [/s] [/b] [/l] [/n] [/x] [/c] [/4]

Drive:Path – directory which contents will be listed.

FileName – file(s) to be listed. Wildcards (?, *) are allowed.

/p – one line on screen per time (to see the next line press any key).

/q – displays file ownership details.

/w – wide format listing (five file/folder names per line).

/d – wide format listing with columns.

/a:Attributes – displays only files with specific attributes:

/o:SortOrder – displays the output sorted in according to the SortOrder:

Without SortOrder specified DIR displays folders, then files, both sorted alphabetically by name.

/t:TimeField – specifies which time field should be used for sorting:

/s – includes contents of subfolders in the output list.

/b – bare list of files (no additional information).

/l– displays unsorted folders and files in lower case.

/n – long list (file names are on the far right of the screen).

/x – long list with short 8.3 names.

/c – displays thousands separator in file sizes.

/-c – hides thousands separator in file sizes.

/4 – displays years in four-digits format.

Usage:

Multiple FileNames parameters should be separated with space, comma or semicolon.

Attributes can be combined, and sort orders can be combined, too.

DIR command options can be preset by DIRCMD variable, like SET DIRCMD=/O:N /S.

Examples:

List all text files in current folder:

DIR *.txt

List all except directories, sort by extension:

DIR /a:-d /o:e

 

Subscribe batch files programming newsletter (no spam):

Subscribe

Unsubscribe