DIR (Directory) - Displays A List of Files and Subdirectories in A Directory
DIR (Directory) - Displays A List of Files and Subdirectories in A Directory
The part of the syntax with forward slash ( / ) are called switches.
Switches:
/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files I Not content indexed files
L Reparse Points O Offline 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 (oldest
first)
G Group directories first - Prefix to reverse order
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/R Display alternate data streams 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 filenames.
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
Use the /D switch to change current drive in addition to changing current directory
for a drive.
The current directory string is converted to use the same case as the on disk
names. So CD C:\TEMP would actually set the current directory to C:\Temp if that is
the case on disk.
cd \winnt\profiles\username\programs\start menu
cd "\winnt\profiles\username\programs\start menu"
( 3 ) MD -- Creates a directory.
Syntax:
MKDIR [drive:]path
MD [drive:]path
MKDIR creates any intermediate directories in the path, if needed. For example,
assume \a does not exist then:
mkdir \a\b\c\d
The switch /Y may be preset in the COPYCMD environment variable. This may be
overridden with /-Y on the command line. Default is to prompt on overwrites unless
COPY command is being executed from
within a batch script.
To append files, specify a single file for destination, but multiple files for source
(using wildcards or file1+file2+file3 format).
The display semantics of the /S switch are reversed in that it shows you only the
files that are deleted, not the ones it could not find.
Note that you cannot specify a new drive or path for your destination file.
Type TIME with no parameters to display the current time setting and a prompt for a
new one. Press ENTER to keep the same time.
If Command Extensions are enabled the TIME command supports the /T switch
which tells the command to just output the current time, without prompting for a
new time.
Type DATE without parameters to display the current date setting and a prompt for
a new one. Press ENTER to keep the same date.
If Command Extensions are enabled the DATE command supports the /T switch
which tells the command to just output the current date, without prompting for a
new date.