---------------------------------------------------------------
Displays or sets the active code page number.
CHCP
nnn Specifies a code page number.
Type CHCP without parameters to display the active code page number.
---------------------------------------------------------------
Displays the current directory name or changes the current directory.
CHDIR
CHDIR
CD
CD
.. Specifies changing to the parent directory.
Type CD drive: to display the current directory on the specified drive.
Type CD with no parameters to display the current drive and directory.
Use the /D command option to change the current drive as well as changing the
current directory for a drive.
If command extensions are enabled, CHDIR changes as follows:
The current directory string is converted to use the case as it appears on disk.
So, if that is the case on the disk, CD C : \TEMP will set the current directory to
C:\Temp.
The CHDIR command does not treat spaces as delimiters, so it is possible to change
to a subdirectory name that contains spaces without using quotes. For example:
cd \winnt\profiles\username\programs\start menu
is the same as:
cd "\winnt\profiles\username\programs\start menu"
When extensions are disabled, you must type the above command.
---------------------------------------------------------------
Checks a disk and displays a status report.
CHKDSK filename]]] ]
volume Specifies the drive (followed by a colon), mount point,
or volume name.
filename FAT only: Specifies the file to check for fragmentation.
/F Fixes errors on the disk.
/V On FAT/FAT32: Displays the full path and name of every file on the disk.
On NTFS: Displays cleanup messages, if any.
/R Locates bad sectors and recovers readable information (implies /F).
/L:size NTFS only: Changes the log file size to the specified number of KB.
If no size is specified, displays the current size.
/X Forces the volume to dismount first, if necessary.
All open handles to the volume become invalid (implies /F).
/I NTFS only: Performs a less vigorous check of index entries.
/C NTFS only: Skips checking of cycles within the folder structure.
The /I and /C command options skip certain checks of the volume, reducing the time
required to run Chkdsk.
---------------------------------------------------------------
Displays or modifies disk checking at startup.
CHKNTFS volume
CHKNTFS /D
CHKNTFS /T\r\nCHKNTFS /X volume
CHKNTFS /C volume
volume: Specifies the drive (followed by a colon), mount point,
or volume name.
/D Restores the computer to the default state, checking all drives at startup
and running the chkdsk command on drives that have problems.
/T:time Changes the AUTOCHK initial countdown time to the specified
amount of time, in seconds. If no time is specified,
displays the current setting.
/X Excludes drives from checking at startup. Drives excluded by
the last execution of this command are no longer valid.
/C Schedules a drive to be checked at startup; if the drive has problems, runs chkdsk.
If no command option is specified, CHKNTFS displays the status of the dirty bit for each drive.
---------------------------------------------------------------
Clears the screen.
CLS
---------------------------------------------------------------
Starts a new instance of the Windows 2000 command interpreter
CMD
string]
/C Executes the command specified by the string and then terminates
/K Executes the command specified by the string but remains
/S Modifies string handling after /C or /K (see below)
/Q Turns echo off
/D Disables execution of AutoRun commands from the registry (see below)
/A Causes output to internal pipes or file commands to be ANSI
/U Causes output to internal pipes or file commands to be Unicode
/T:fg Sets foreground/background colors (for details, see COLOR /?)
/E:ON Enables command extensions (see below)
/E:OFF Disables command extensions (see below)
/F:ON Enables file and directory name completion characters (see below)
/F:OFF Disables file and directory name completion characters (see below)
/V:ON Starts delayed environment variable expansion using c as the delimiter. For example: /V:ON
allows !var! to expand the variable var at execution time. The var syntax
expands variables at input time, which is different inside a FOR loop.
/V:OFF Disables delayed environment expansion.
Note that if the string is quoted, multiple commands separated by the command separator
'&&' are accepted. Also, for compatibility reasons, /X is the same as /E:ON, /Y is
the same as /E:OFF, and /R is the same as /C. Any other command options are ignored.
If /C or /K is specified, the rest of the command line after the command options is
processed as a command line; in this case, the following logic is used to process
quote characters ("

:
1. If all of the following conditions are met, quote characters on the command
line are preserved:
- No /S command option
- Exactly two quote characters
- No special characters between the two quote characters, the special characters being
one of the following: ()@^|
- At least one whitespace character between the two quote characters
- At least one executable file name between the two quote characters.
2. Otherwise, the old method is used: if the first character is a quote character,
discard the leading character and delete the last quote character on the command line,
preserving any text after the last quote character.
If /D is not specified on the command line, when CMD.EXE starts it looks for the
following REG_SZ/REG_EXPAND_SZ registry variables. If either or both exist, they
are executed first.
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
Command extensions are enabled by default. You can also use /E:OFF to disable
extensions for a particular invocation. You can enable or disable extensions for
all invocations of CMD.EXE on the machine and/or user logon session by setting
one or both of the following REG_DWORD values in the registry using REGEDT32.EXE:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
to 0x1 or 0x0. User-specific settings take precedence over machine settings.
Command-line command options take precedence over registry settings.
Command-line extensions include changes and/or additions to the following commands:
DEL or ERASE
COLOR
CD or CHDIR
MD or MKDIR
PROMPT
PUSHD
POPD
SET
SETLOCAL
ENDLOCAL
IF
FOR
CALL
SHIFT
GOTO
START (also including changes made to external command invocation)
ASSOC
FTYPE
For details, type HELP command-name.
Delayed variable environment expansion is not enabled by default. You can use the
/V:ON or /V:OFF command options to enable or disable delayed environment variable
expansion for a particular invocation of CMD.EXE. You can enable or disable
completion for all invocations of CMD.EXE on the machine and/or user logon session
by setting one or both of the following REG_DWORD values in the registry using
REGEDT32.EXE:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DelayedExpansion
to 0x1 or 0x0. User-specific settings take precedence over machine settings.
Command-line command options take precedence over registry settings.
If delayed environment variable expansion is enabled, the exclamation point character
can be used at execution time to substitute the value of an environment variable.
File and directory name completion is not enabled by default. You can use the
/F:ON or /F:OFF command options to enable or disable file name completion for a
particular invocation of CMD.EXE. You can enable or disable completion for all
invocations of CMD.EXE on the machine and/or user logon session by setting one or
both of the following REG_DWORD values in the registry using REGEDT32.EXE:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar
using the hexadecimal value of a control character as a specific parameter
(for example, 0x4 is Ctrl-D, 0x6 is Ctrl-F). User-specific settings take precedence
over machine settings. Command-line command options take precedence over registry settings.
If completion is enabled with the /F:ON command option, the two control characters
to use are: Ctrl-D for directory name completion and Ctrl-F for file name completion.
To disable a character in the registry, use the value for space (0x20), because
this character is not a control character.
If you type one of the two control characters, completion is invoked. The completion
function takes the path string to the left of the cursor, appends a wildcard to the
left if there is no wildcard, and builds a list of matching paths. It then displays
the first matching path. If there is no matching path, it beeps and does not affect
the display. After that, pressing the same control character repeatedly cycles through
the list of matching paths. Pressing Shift together with the control character displays
the list in reverse. If any editing is done to the line and the control character is
pressed again, the saved list of matching paths is discarded and a new one is generated.
The same occurs if switching between file and directory name completion. The only
difference between the two control characters is that the file completion character
matches file and directory names, while the directory completion character only matches
directory names. If file completion is used with built-in directory commands (CD, MD or RD),
directory completion is used.
By putting quotes around matching paths, the completion code can correctly handle
file names containing spaces or other special characters. Also, if you back up and
then invoke file completion from within the line, text to the right of the cursor
when completion is invoked will be discarded.
---------------------------------------------------------------
Sets the default console foreground and background colors.
COLOR
attr Specifies the color attribute of console output
Color attributes are specified by two hexadecimal digits -- the first is the background,
and the second is the foreground. Each digit can be any of the following values:
0 = black 8 = gray
1 = blue 9 = light blue
2 = green A = light green
3 = aqua B = light aqua
4 = red C = light red
5 = purple D = light purple
6 = yellow E = light yellow
7 = white F = bright white
If no argument is given, the command restores the colors to those at CMD.EXE startup.
This value comes from the current console window, the /T command-line option, or the
DefaultColor registry value.
If the COLOR command is executed with the same foreground and background color,
the COLOR command sets ERRORLEVEL to 1.
For example: "COLOR fc" produces bright red on bright white
---------------------------------------------------------------
Compares the contents of two files or sets of files.
COMP
data1 Specifies the location and name of the first file(s) to compare.
data2 Specifies the location and name of the second file(s) to compare.
/D Displays differences in numeric format.
/A Displays differences in ASCII characters..
/L Displays line number differences.
/N=number Compares only the first specified number of lines of each file.
/C Ignores the case of ASCII characters when comparing files.
To compare sets of files, use wildcards in the data1 and data2 parameters.
---------------------------------------------------------------
Displays or changes the compression of files on NTFS partitions.
COMPACT ] ]
/C Compresses the specified files. Directories are marked so that files
added later will be compressed.
/U Uncompresses the specified files. Directories are marked so that files
added later will not be compressed.
/S Performs the specified operation on files in the specified directory
and all subdirectories. The default "dir" is the current directory.
/A Displays files with hidden or system attributes. By default,
these files are ignored.
/I Continues performing the specified operation even after errors occur.
By default, COMPACT stops when it encounters an error.
/F On all--------------------------------------------------------------
Converts a FAT volume to NTFS.
CONVERT volume /FS:NTFS
volume Specifies the drive (followed by a colon), mount point,
or volume name.
/FS:NTFS Specifies that the volume is to be converted to NTFS.
/V Specifies that conversion must be performed in verbose mode.
---------------------------------------------------------------
Copies one or more files to another location.
COPY source
] ]
source Specifies the file to copy.
/A Indicates an ASCII text file.
/B Indicates a binary file.
destination Specifies the directory and/or file name for the new file.
/V Verifies that new files are written correctly.
/N When copying a file with a non-8dot3 name,
uses the short file name if possible.
/Y Suppresses prompting to confirm that you want to overwrite
an existing destination file.
/-Y Causes prompting to confirm that you want to overwrite
an existing destination file.
/Z Copies networked files in restartable mode.
The /Y command option can be preset in the COPYCMD environment variable.
This can be overridden by /-Y on the command line. Unless the COPY
command is executed in a batch file script, the default should be to prompt
when overwriting.
To append files, specify one file as the destination and several files as the source
(using wildcards or the file1+file2+file3 format).
---------------------------------------------------------------
Displays or sets the date.
DATE
Type DATE without parameters to display the current date setting and prompt
you to enter a new date. Press ENTER to keep the original date.
If command extensions are enabled, the DATE command supports the /T command option;
this option tells the command to output only the current date without prompting
for a new date.
---------------------------------------------------------------
Deletes one or more files.
DEL attributes]] names
ERASE attributes]] names
names Specifies a list of one or more files or directories. Wildcards can be used
to delete multiple files. If a directory is specified, all files in the
directory are deleted.
/P Prompts for confirmation before deleting each file.
/F Forces deletion of read-only files.
/S Deletes specified files from all subdirectories.
/Q Quiet mode. Does not ask for confirmation when deleting with global wildcards.
/A Selects files to delete based on attributes.
attributes R Read-only files S System files
H Hidden files A Archive files
- Prefix meaning "not"
If command extensions are enabled, DEL and ERASE change as follows:
The display syntax of the /S command option is reversed, that is, it shows you only
files that have been deleted, and does not show files that could not be found.
---------------------------------------------------------------
Displays a list of files and subdirectories in a directory.
DIR attributes]]
sortorder]] timefield]]
Specifies the drive, directory and/or files to list.
/A Displays files with the 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 Displays thousands separators in file sizes. This is the default. Use /-C
to disable separator display.
/D Same as wide format, but files are listed sorted by column.
/L Uses lowercase.
/N New long list format, with file names at the far right.
/O Lists files in sorted order.
sortorder N By name (alphabetical) S By size (smallest first)
E By extension (alphabetical) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/P Pauses after each screen of information.
/Q Displays file owner.
/S Displays files in the specified directory and all subdirectories.
/T Controls which time field is displayed or used for sorting.
timefield C Creation time
A Last access time
W Last write time
/W Uses wide list format.
/X Displays the short names generated for non-8dot3 file names. The format is /N format,
with the short name inserted before the long name. If there is no short name,
blanks are displayed in its place.
/4 Displays the year with four digits
Command options can be preset in the DIRCMD environment variable. Override preset
command options by prefixing with - (hyphen), for example, /-W.
---------------------------------------------------------------