\
Skip Navigation LinksHome > Coding > Scripting > MS-DOS > View Item Info\
 
 
[]Return to List
[]UDF / UDC Library
[]Script Library



 

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.
  • /B
    Uses 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.


Constants
MS-DOS does not use any constants


Return Type
None.


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 .

Help Support Dx21
Buy Thru Us

 FAQs  |  Terms Of Use  |  Privacy Policy  |  Contact Us
Copyright © 1997 - 2010 Dx21, LLC. All rights reserved.
Dx21, LLC a Washington Limited Liability Company
Page Rendered at: 9/8/2010 10:24:40 PM for Unknown