|
Showing:
DIR Commands
Displays a list of files and subdirectories in a directory.
*
DIR [drive:][path][filename] [Switches....]
[Arguments] |
[Constants] |
[Return Type] |
[Script Example]
|
Arguments
|
[drive:][path][filename]
(Optional) Specifies drive, directory, and/or files to list. (Could be enhanced file specification or multiple filespecs.)
[Switches] (Optional) Switches used in a space deliminated list where the following list of switches are available:
- /P
Pauses after each screenful of information.
- /W
Uses wide list format.
- /A [/A[[:]attributes]]
Displays files with specified attributes, where those attributes are:
- D = Directories
- R = Read-only files
- H = Hidden files
- A = Files ready for archiving
S = System files
/O [/O[[:]sortorder]] List by files in sorted order, where the sort order is specified as:
- N = By name (alphabetic)
- S = By size (smallest first)
- E = By extension (alphabetic)
- D = By date & time (earliest first)
- G = Group directories first
- A = By Last Access Date (earliest first)
/S Displays files in specified directory and all subdirectories.
/BUses bare format (no heading information or summary).
/L Uses lowercase.
/V Verbose mode.
/4 Displays year with 4 digits (ignored if /V also given).
Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.
|
|
Script Example
|
|
Unless otherwise noted, this code is licensed according to the terms and conditions listed
here. |
DIR C:\WINDOWS /P /A:S /O:E /4 |
* This text may contain reprinted material from the
Microsoft
.
|