----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

DIR

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Common
Command Set
INTERNAL

  ASSOC | BREAK | CALL | CD | CHDIR | CLS | COLOR | COPY | DATE | DEL | DIR | ECHO | ENDLOCAL | ERASE | EXIT | FOR | FTYPE | GOTO | IF | MD | MEM | MKDIR | MOVE | PATH | PAUSE | POPD | PROMPT | PUSHD | RD | REM | REN | RENAME | RMDIR | SET | SETLOCAL | SHIFT | START | TIME | TITLE | TYPE | VER | VERIFY | VOL

K

E

Y

Common Commands INTERNAL External /SWITCH Parameter Help text AddonTool
Mounted Commands .Mount/\Command CmdShorthand #Constant $FUNCTION :Procedure !GuardNote
Operating Systems NT/2K/XP/K3 NT Only NT/2K 2K Only 2K/XP XP Only XP/K3 K3 Only 2K/XP/K3

Related Resources from the NT/2K/XP/K3 Command Library

Resource

  Short Description
     

Go straight to !GuardNotes. (updated 2004-07-13)


This is the Mounted Help Text.  We also archive the Common Help Text for NT, 2K, XP and K3

Description

Displays a list of files and subdirectories in a directory.

Syntax

DIR

  [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

Parameters and Switches

[drive:][path][filename]

  Specifies drive, directory, and/or files to list.

/A

  Displays files with specified attributes.

attributes

  D Directories
R Read-only files
H Hidden files
A Files ready for archiving
S System files
- Prefix meaning not

/B

  Uses bare format (no heading information or summary).

/C

  Display the thousand separator in file sizes. This is the default. Use /-C to disable display of separator.

/D

  Same as wide but files are list sorted by column.

/L

  Uses lowercase.

/N

  New long list format where filenames are on the far right.

/O

  List by files in sorted order.

sortorder

  N By name (alphabetic)
S By size (smallest first)
E By extension (alphabetic)
D By date & time (earliest first)
G Group directories first
- Prefix to reverse order

/P

  Pauses after each screenful of information.

/Q

  Display the owner of the file.

/S

  Displays files in specified directory and all subdirectories.

/T

  Controls which time field displayed or used for sorting

timefield

  C Creation
A Last Access
W Last Written

/W

  Uses wide list format.

/X

  This displays the short names generated for non-8dot3 file names. The format is that of /N with the short name inserted before the long name. If no short name is present, blanks are displayed in its place.

/4

  Displays four-digit years

Examples, Notes and Instructions

Switches may be preset in the DIRCMD environment variable. Override preset switches by prefixing any switch with - (hyphen)--for example, /-W.


GuardNotes

Things that are different (by design, by accident or otherwise)

Help Screen Reorganized

Although the DIR help screen looks quite different in 2K as opposed to NT, the only real changes are the additions of the /Q and /4 switches.  The rest of the help screen changes are just putting the switches in alphabetical order.

Inconsistent Errorlevels Returned

A request for a nonexistent file or directory returns different errorlevels depending upon OS and whether a trailing backslash is specified.

-------Begin (checkel.cmd)-------

@ECHO OFF
%* >NUL
ECHO:EL=%errorlevel%

--------End (checkel.cmd)--------

Assume no matching files or folders (ABC, abc, etc.) exist in the current directory:

Example #1

C:\>checkel dir abc

NT

File Not Found
EL=2

2K/XP

File Not Found
EL=1

Example #2 (ending with a backslash)

C:\>checkel dir abc\

NT/2K/XP

The system cannot find the file specified.
EL=1


Common
Command Set
INTERNAL

  ASSOC | BREAK | CALL | CD | CHDIR | CLS | COLOR | COPY | DATE | DEL | DIR | ECHO | ENDLOCAL | ERASE | EXIT | FOR | FTYPE | GOTO | IF | MD | MEM | MKDIR | MOVE | PATH | PAUSE | POPD | PROMPT | PUSHD | RD | REM | REN | RENAME | RMDIR | SET | SETLOCAL | SHIFT | START | TIME | TITLE | TYPE | VER | VERIFY | VOL
/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\