MS-DOS commands for Windows®
2000/XP/Vista/7/Server 2003/Server 2008

Jump :
#top
A B
C D
E F
G H
I J
K L
M N
O P
Q R
S T
U V
W X
Y Z

Some variables : %comspec%, %errorlevel%, %logonserver%, %path%

Note that availability isn't specified for versions of Windows prior to Windows 2000.

A

ARP

Availability: +Windows 2000 Professional | +Windows 2000 Server

Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP).

ARP -s inet_addr eth_addr [if_addr]

ARP -d inet_addr [if_addr]

ARP -a [inet_addr] [-N if_addr] [-v]

-aDisplays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.
-gSame as -a.
-vDisplays current ARP entries in verbose mode. All invalid entries and entries on the loop-back interface will be shown.
inet_addrSpecifies an internet address.
-N if_addrDisplays the ARP entries for the network interface specified by if_addr.
-dDeletes the host specified by inet_addr. inet_addr may be wildcarded with * to delete all hosts.
-sAdds the host and associates the Internet address inet_addr with the Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent.
eth_addrSpecifies a physical address.
if_addrIf present, this specifies the Internet address of the interface whose address translation table should be modified. If not present, the first applicable interface will be used.

Example:

> arp -s 157.55.85.212 00-aa-00-62-c6-09Adds a static entry.
> arp -aDisplays the arp table.

ASSOC

Availability: +Windows 2000 Professional | +Windows 2000 Server

Displays or modifies file extension associations.

ASSOC [.ext[=[fileType]]]

.extSpecifies the file extension to associate the file type with
fileTypeSpecifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations. If ASSOC is invoked with just a file extension, it displays the current file association for that file extension. Specify nothing for the file type and the command will delete the association for the file extension.

AT

Availability: +Windows 2000 Professional | +Windows 2000 Server

The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES] ]

AT [\\computername] time [/INTERACTIVE] [ /EVERY:date[,...] | /NEXT:date[,...] ] "command"

\\computernameSpecifies a remote computer. Commands are scheduled on the local computer if this parameter is omitted.
idIs an identification number assigned to a scheduled command.
/deleteCancels a scheduled command. If id is omitted, all the scheduled commands on the computer are canceled.
/yesUsed with cancel all jobs command when no further confirmation is desired.
timeSpecifies the time when command is to run.
/interactiveAllows the job to interact with the desktop of the user who is logged on at the time the job runs.
/every:date[,...]Runs the command on each specified day(s) of the week or month. If date is omitted, the current day of the month is assumed.
/next:date[,...]Runs the specified command on the next occurrence of the day (for example, next Thursday). If date is omitted, the current day of the month is assumed.
"command"Is the Windows NT command, or batch program to be run.

Use SCHTASKS instead

APPEND

Availability: Windows 2000/XP Professional | Windows 2000 Server family

APPEND Drive: \Path /X /E Path:[on|off]

\PathThe path to be searched.
/X:[on|off]Extends the DOS search path for specified files when executing programs. Processes SEARCH FIRST, FIND FIRST and EXEC functions. The :ON and :OFF are new to version MS-DOS 5.0.
/Path:[on|off]If path is already included for a program file, :on tells program to also search in appended directories. Default= :on. Note: The default value of = :on was added in MS-DOS 5.0 and above.
/ECauses the appended path to be stored in the DOS environment and searched for there.
;Use ";" to separate multiple Drive:\path statements on one line.

ATTRIB

Availability: +Windows 2000 Professional | +Windows 2000 Server

Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I] [drive:][path][filename] [/S [/D] [/L]]

+Sets an attribute.
-Clears an attribute.
RRead-only file attribute.
AArchive file attribute.
SSystem file attribute.
HHidden file attribute.
INot content indexed file attribute.
[drive:][path][filename]Specifies a file or files for attrib to process.
/SProcesses matching files in the current folder and all subfolders.
/DProcesses folders as well.
/LWork on the attributes of the Symbolic Link versus the target of the Symbolic Link.

B

BREAK

Availability: +Windows 2000 Professional | +Windows 2000 Server

Sets or clears extended CTRL+C checking on DOS system.

This is present for compatibility with DOS systems. It has no effect under Windows.

If Command Extensions are enabled, and running on the Windows platform, then the BREAK command will enter a hard coded breakpoint if being debugged by a debugger.

BCDEDIT

Availability: +Windows Vista | +Windows Server 2008

BCDEDIT - Boot Configuration Data Store Editor

The Bcdedit.exe command-line tool modifies the boot configuration data store. The boot configuration data store contains boot configuration parameters and controls how the operating system is booted. These parameters were previously in the Boot.ini file (in BIOS-based operating systems) or in the nonvolatile RAM entries (in Extensible Firmware Interface-based operating systems). You can use Bcdedit.exe to add, delete, edit, and append entries in the boot configuration data store.

For detailed command and option information, type bcdedit.exe /? <command>. For example, to display detailed information about the /createstore command, type: bcdedit.exe /? /createstore

For an alphabetical list of topics in this help file, run bcdedit /? TOPICS.

== Commands that operate on a store ==

/createstoreCreates a new and empty boot configuration data store.
/exportExports the contents of the system store to a file. This file can be used later to restore the state of the system store.
/importRestores the state of the system store using a backup file created with the /export command.
/sysstoreSets the system store device (only affects EFI systems, does not persist across reboots, and is only used in cases where the system store device is ambiguous).

== Commands that operate on entries in a store ==

/copyMakes copies of entries in the store.
/createCreates new entries in the store.
/deleteDeletes entries from the store.

Run bcdedit /? ID for information about identifiers used by these commands.

== Commands that operate on entry options ==

/deletevalueDeletes entry options from the store.
/setSets entry option values in the store.

Run bcdedit /? TYPES for a list of datatypes used by these commands.

Run bcdedit /? FORMATS for a list of valid data formats.

== Commands that control output ==

/enumLists entries in the store.
/vCommand-line option that displays entry identifiers in full, rather than using names for well-known identifiers. Use /v by itself as a command to display entry identifiers in full for the ACTIVE type.

Running bcdedit by itself is equivalent to running bcdedit /enum ACTIVE.

== Commands that control the boot manager ==

/bootsequenceSets the one-time boot sequence for the boot manager.
/defaultSets the default entry that the boot manager will use.
/displayorderSets the order in which the boot manager displays the multiboot menu.
/timeoutSets the boot manager time-out value.
/toolsdisplayorderSets the order in which the boot manager displays the tools menu.

== Commands that control Emergency Management Services for a boot application ==

/bootemsEnables or disables Emergency Management Services for a boot application.
/emsEnables or disables Emergency Management Services for an operating system entry.
/emssettingsSets the global Emergency Management Services parameters.

== Command that control debugging ==

/bootdebugEnables or disables boot debugging for a boot application.
/dbgsettingsSets the global debugger parameters.
/debugEnables or disables kernel debugging for an operating system entry.
/hypervisorsettingsSets the hypervisor parameters.

C

CACLS

NOTE: Cacls is now deprecated, please use Icacls.

Displays or modifies access control lists (ACLs) of files.

CACLS filename [/T] [/M] [/L] [/S[:SDDL]] [/E] [/C] [/G user:perm] [/R user [...]] [/P user:perm [...]] [/D user [...]]

filenameDisplays ACLs.
/TChanges ACLs of specified files in the current directory and all subdirectories.
/LWork on the Symbolic Link itself versus the target.
/MChanges ACLs of volumes mounted to a directory.
/SDisplays the SDDL string for the DACL.
/S:SDDLReplaces the ACLs with those specified in the SDDL string (not valid with /E, /G, /R, /P, or /D).
/EEdit ACL instead of replacing it.
/C Continue on access denied errors.
/G user:permGrant specified user access rights.
Perm can be:RRead
WWrite
CChange (write)
FFull control
/R userRevoke specified user's access rights (only valid with /E).
/P user:permReplace specified user's access rights.
Perm can be:NNone
RRead
WWrite
CChange (write)
FFull control
/D userDeny specified user access.

Wildcards can be used to specify more that one file in a command.

You can specify more than one user in a command.

Abbreviations:

CI- Container Inherit. The ACE will be inherited by directories.
OI- Object Inherit. The ACE will be inherited by files.
IO- Inherit Only. The ACE does not apply to the current file/directory.
ID- Inherited. The ACE was inherited from the parent directory's ACL.

CALL

Calls one batch program from another.

CALL [drive:][path]filename [batch-parameters]

batch-parametersSpecifies any command-line information required by the batch program.

If Command Extensions are enabled CALL changes as follows:

CALL command now accepts labels as the target of the CALL. The syntax is:

CALL :label arguments

A new batch file context is created with the specified arguments and control is passed to the statement after the label specified. You must “exit” twice by reaching the end of the batch script file twice. The first time you read the end, control will return to just after the CALL statement. The second time will exit the batch script. Type GOTO /? for a description of the GOTO :EOF extension that will allow you to “return” from a batch script.

In addition, expansion of batch script argument references (%0, %1, etc.) have been changed as follows:

%* in a batch script refers to all the arguments (e.g. %1 %2 %3 %4 %5 ...)

Substitution of batch parameters (%n) has been enhanced. You can now use the following optional syntax:

%~1- expands %1 removing any surrounding quotes (")
%~f1- expands %1 to a fully qualified path name
%~d1- expands %1 to a drive letter only
%~p1- expands %1 to a path only
%~n1- expands %1 to a file name only
%~x1- expands %1 to a file extension only
%~s1- expanded path contains short names only
%~a1- expands %1 to file attributes
%~t1- expands %1 to date/time of file
%~z1- expands %1 to size of file
%~$PATH:1- searches the directories listed in the PATH environment variable and expands %1 to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, then this modifier expands to the empty string

The modifiers can be combined to get compound results:

%~dp1- expands %1 to a drive letter and path only
%~nx1- expands %1 to a file name and extension only
%~dp$PATH:1- searches the directories listed in the PATH environment variable for %1 and expands to the drive letter and path of the first one found.
%~ftza1- expands %1 to a DIR like output line

In the above examples %1 and PATH can be replaced by other valid values. The %~ syntax is terminated by a valid argument number. The %~ modifiers may not be used with %*.

CD, CHDIR

Availability: +Windows 2000 Professional | +Windows 2000 Server

Displays the name of or changes the current directory.

CHDIR [/D] [drive:][path]

CHDIR [..]

CD [/D] [drive:][path]

CD [..]

..Specifies that you want to change to the parent directory.

Type CD drive: to display the current directory in the specified drive. Type CD without parameters to display the current drive and directory.

Use the /D switch to change current drive in addition to changing current directory for a drive.

If Command Extensions are enabled CHDIR changes as follows:

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.

CHDIR command does not treat spaces as delimiters, so it is possible to CD into a subdirectory name that contains a space without surrounding the name with quotes. For example:

cd \winnt\profiles\username\programs\start menu

is the same as:

cd "\winnt\profiles\username\programs\start menu"

which is what you would have to type if extensions were disabled.

CHCP

Displays or sets the active code page number.

CHCP [nnn]

nnnSpecifies a code page number.

Type CHCP without a parameter to display the active code page number.

CHKDSK

Checks a disk and displays a status report.

CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]] [/B]

volumeSpecifies the drive letter (followed by a colon), mount point, or volume name.
filenameFAT/FAT32 only: Specifies the files to check for fragmentation.
/FFixes errors on the disk.
/VOn FAT/FAT32: Displays the full path and name of every file on the disk. On NTFS: Displays cleanup messages if any.
/RLocates bad sectors and recovers readable information (implies /F).
/L:sizeNTFS only: Changes the log file size to the specified number of kilobytes. If size is not specified, displays current size.
/XForces the volume to dismount first if necessary. All opened handles to the volume would then be invalid (implies /F).
/INTFS only: Performs a less vigorous check of index entries.
/CNTFS only: Skips checking of cycles within the folder structure.
/BNTFS only: Re-evaluates bad clusters on the volume (implies /R)

The /I or /C switch reduces the amount of time required to run Chkdsk by skipping certain checks of the volume.

CHKNTFS [+Server 2003|+XP]

Displays or modifies the checking of disk at boot time.

CHKNTFS volume [...]

CHKNTFS /D

CHKNTFS /T[:time]

CHKNTFS /X volume [...]

CHKNTFS /C volume [...]

volumeSpecifies the drive letter (followed by a colon), mount point, or volume name.
/DRestores the machine to the default behavior; all drives are checked at boot time and chkdsk is run on those that are dirty.
/T:timeChanges the AUTOCHK initiation countdown time to the specified amount of time in seconds. If time is not specified, displays the current setting.
/XExcludes a drive from the default boot-time check. Excluded drives are not accumulated between command invocations.
/CSchedules a drive to be checked at boot time; chkdsk will run if the drive is dirty.

If no switches are specified, CHKNTFS will display if the specified drive is dirty or scheduled to be checked on next reboot.

CIPHER

Displays or alters the encryption of directories [files] on NTFS partitions.

CIPHER [/E | /D | /C] [/S:directory] [/B] [/H] [pathname [...]]

CIPHER /K [/ECC:256|384|521]

CIPHER /R:filename [/SMARTCARD] [/ECC:256|384|521]

CIPHER /U [/N]

CIPHER /W:directory

CIPHER /X[:efsfile] [filename]

CIPHER /Y

CIPHER /ADDUSER [/CERTHASH:hash | /CERTFILE:filename | /USER:username] [/S:directory] [/B] [/H] [pathname [...]]

CIPHER /FLUSHCACHE [/SERVER:servername]

CIPHER /REMOVEUSER /CERTHASH:hash [/S:directory] [/B] [/H] [pathname [...]]

CIPHER /REKEY [pathname [...]]

/BAbort if an error is encountered. By default, CIPHER continues executing even if errors are encountered.
/CDisplays information on the encrypted file.
/DDecrypts the specified files or directories.
/EEncrypts the specified files or directories. Directories will be marked so that files added afterward will be encrypted. The encrypted file could become decrypted when it is modified if the parent directory is not encrypted. It is recommended that you encrypt the file and the parent directory.
/HDisplays files with the hidden or system attributes. These files are omitted by default.
/KCreates a new certificate and key for use with EFS. If this option is chosen, all the other options will be ignored.
Note: By default, /K creates a certificate and key that conform to current group policy. If ECC is specified, a self-signed certificate will be created with the supplied key size.
/NThis option only works with /U. This will prevent keys being updated. This is used to find all the encrypted files on the local drives.
/RGenerates an EFS recovery key and certificate, then writes them to a .PFX file (containing certificate and private key) and a .CER file (containing only the certificate). An administrator may add the contents of the .CER to the EFS recovery policy to create the recovery key for users, and import the .PFX to recover individual files. If SMARTCARD is specified, then writes the recovery key and certificate to a smart card. A .CER file is generated (containing only the certificate). No .PFX file is generated.
Note: By default, /R creates an 2048-bit RSA recovery key and certificate. If ECC is specified, it must be followed by a key size of 256, 384, or 521.
/SPerforms the specified operation on the given directory and all files and subdirectories within it.
/UTries to touch all the encrypted files on local drives. This will update user's file encryption key or recovery keys to the current ones if they are changed. This option does not work with other options except /N.
/WRemoves data from available unused disk space on the entire volume. If this option is chosen, all other options are ignored. The directory specified can be anywhere in a local volume. If it is a mount point or points to a directory in another volume, the data on that volume will be removed.
/XBackup EFS certificate and keys into file filename. If efsfile is provided, the current user's certificate(s) used to encrypt the file will be backed up. Otherwise, the user's current EFS certificate and keys will be backed up.
/YDisplays your current EFS certificate thumbnail on the local PC.
/ADDUSERAdds a user to the specified encrypted file(s). If CERTHASH is provided, cipher will search for a certificate with this SHA1 hash. If CERTFILE is provided, cipher will extract the certificate from the file. If USER is provided, cipher will try to locate the user's certificate in Active Directory Domain Services.
/FLUSHCACHEClears the calling user's EFS key cache on the specified server. If servername is not provided, cipher clears the user's key cache on the local machine.
/REKEYUpdates the specified encrypted file(s) to use the configured EFS current key.
/REMOVEUSERRemoves a user from the specified file(s). CERTHASH must be the SHA1 hash of the certificate to remove.
directoryA directory path.
filenameA filename without extensions.
pathnameSpecifies a pattern, file or directory.
efsfileAn encrypted file path.

Used without parameters, CIPHER displays the encryption state of the current directory and any files it contains. You may use multiple directory names and wildcards. You must put spaces between multiple parameters.

CLIP [+Server 2008|+Vista]

Description: Redirects output of command line tools to the Windows clipboard. This text output can then be pasted into other programs.

Parameter List:

/?Displays this help message.

Examples:

DIR | CLIPPlaces a copy of the current directory listing into the Windows clipboard.
CLIP < README.TXTPlaces a copy of the text from readme.txt on to the Windows clipboard.

CLS [+Server 2003|+XP]

Clears the screen.

CLS

CMD

Availability: +Windows 2000 Professional | +Windows 2000 Server

Starts a new instance of the Windows command interpreter

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string]

/CCarries out the command specified by string and then terminates
/KCarries out the command specified by string but remains
/SModifies the treatment of string after /C or /K (see below)
/QTurns echo off
/DDisable execution of AutoRun commands from registry (see below)
/ACauses the output of internal commands to a pipe or file to be ANSI
/UCauses the output of internal commands to a pipe or file to be Unicode
/T:fgSets the foreground/background colors (see COLOR /? for more info)
/E:ONEnable command extensions (see below)
/E:OFFDisable command extensions (see below)
/F:ONEnable file and directory name completion characters (see below)
/F:OFFDisable file and directory name completion characters (see below)
/V:ONEnable delayed environment variable expansion using ! as the delimiter. For example, /V:ON would allow !var! to expand the variable var at execution time. The var syntax expands variables at input time, which is quite a different thing when inside of a FOR loop.
/V:OFFDisable delayed environment expansion.

Note that multiple commands separated by the command separator '&&' are accepted for string if surrounded by quotes. 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 switches are ignored.

If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters:

1. If all of the following conditions are met, then quote characters on the command line are preserved:

- no /S switch

- exactly two quote characters

- no special characters between the two quote characters, where special is one of: & < > ( ) @ ^ |

- there are one or more whitespace characters between the two quote characters

- the string between the two quote characters is the name of an executable file.

2. Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character.

If /D was NOT specified on the command line, then when CMD.EXE starts, it looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if either or both are present, 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 may also disable extensions for a particular invocation by using the /E:OFF switch. You can enable or disable extensions for all invocations of CMD.EXE on a machine and/or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDIT.EXE:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions

and/or

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions

to either 0x1 or 0x0. The user specific setting takes precedence over the machine setting. The command line switches take precedence over the registry settings.

The command extensions involve 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 includes changes to external command invocation) ; ASSOC ; FTYPE

To get specific details, type commandname /? to view the specifics.

Delayed environment variable expansion is NOT enabled by default. You can enable or disable delayed environment variable expansion for a particular invocation of CMD.EXE with the /V:ON or /V:OFF switch. You can enable or disable delayed expansion for all invocations of CMD.EXE on a machine and/or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDIT.EXE:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion

and/or

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DelayedExpansion

to either 0x1 or 0x0. The user specific setting takes precedence over the machine setting. The command line switches take precedence over the registry settings.

If delayed environment variable expansion is enabled, then the exclamation character can be used to substitute the value of an environment variable at execution time.

You can enable or disable file name completion for a particular invocation of CMD.EXE with the /F:ON or /F:OFF switch. You can enable or disable completion for all invocations of CMD.EXE on a machine and/or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDIT.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

with the hex value of a control character to use for a particular function (e.g. 0x4 is Ctrl-D and 0x6 is Ctrl-F). The user specific settings take precedence over the machine settings. The command line switches take precedence over the registry settings.

If completion is enabled with the /F:ON switch, the two control characters used are Ctrl-D for directory name completion and Ctrl-F for file name completion. To disable a particular completion character in the registry, use the value for space (0x20) as it is not a valid control character.

Completion is invoked when you type either of the two control characters. The completion function takes the path string to the left of the cursor appends a wild card character to it if none is already present and builds up a list of paths that match. It then displays the first matching path. If no paths match, it just beeps and leaves the display alone. Thereafter, repeated pressing of the same control character will cycle through the list of matching paths. Pressing the Shift key with the control character will move through the list backwards. If you edit the line in any way and press the control character again, the saved list of matching paths is discarded and a new one generated. The same occurs if you switch between file and directory name completion. The only difference between the two control characters is the file completion character matches both file and directory names, while the directory completion character only matches directory names. If file completion is used on any of the built in directory commands (CD, MD or RD) then directory completion is assumed.

The completion code deals correctly with file names that contain spaces or other special characters by placing quotes around the matching path. Also, if you back up, then invoke completion from within a line, the text to the right of the cursor at the point completion was invoked is discarded.

The special characters that require quotes are: <space> & ( ) [ ] { } ^ = ; ! ' + , ` ~

CMSTP [+Server 2008|+Vista]

Connection Manager Profile Installer

Modes:

Profile Install -- cmstp.exe [/ni /ns /nf /s /su /sd /au] <Full Path to Profile Inf>

Profile Uninstall -- cmstp.exe /u [/s] <Full Path to Profile Inf>

Help -- cmstp.exe /?

Long paths to Inf files must be enclosed in double quotes (").

Install Modifiers:

/nsNo Desktop Shortcut
/niNo Desktop Shortcut (Windows ME & NT, or lower)
/nfSkip Support File Dependency Check
/sSilent Install
/suSingle User Install
/sdSet this connection as the IE default connection
/auAll User Install (Administrators only)

Uninstall Modifiers:

/uSpecifies that the service profile should be uninstalled
/sNo Uninstall Confirmation Prompt

Please see the Connection Manager Administration Kit [CMAK] documentation for further details about the usage of cmstp.exe.

More details/examples here <http://technet.microsoft.com/en-us/library/ff961501(v=ws.10)>

COLOR

Availability: +Windows 2000 Professional | +Windows 2000 Server

Sets the default console foreground and background colors.

COLOR [attr]

attrSpecifies color attribute of console output

Color attributes are specified by TWO hex digits -- the first corresponds to the background; the second the foreground. Each digit can be any of the following values:

0= Black8= Gray
1= Blue9= Light Blue
2= GreenA= Light Green
3= AquaB= Light Aqua
4= RedC= Light Red
5= PurpleD= Light Purple
6= YellowE= Light Yellow
7= WhiteF= Bright White

If no argument is given, this command restores the color to what it was when CMD.EXE started. This value either comes from the current console window, the /T command line switch or from the DefaultColor registry value.

The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute the COLOR command with a foreground and background color that are the same.

Example: COLOR fc produces light red on bright white

COMP [+Server 2003|+XP]

Compares the contents of two files or sets of files.

COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C] [/OFF[LINE]]

data1Specifies location and name(s) of first file(s) to compare.
data2Specifies location and name(s) of second files to compare.
/DDisplays differences in decimal format.
/ADisplays differences in ASCII characters.
/LDisplays line numbers for differences.
/N=numberCompares only the first specified number of lines in each file.
/CDisregards case of ASCII letters when comparing files.
/OFF[LINE]Do not skip files with offline attribute set.

To compare sets of files, use wildcards in data1 and data2 parameters.

COMPACT [+Server 2003|+XP]

Displays or alters the compression of files on NTFS partitions.

COMPACT [/C | /U] [/S[:dir]] [/A] [/I] [/F] [/Q] [filename [...]]

/CCompresses the specified files. Directories will be marked so that files added afterward will be compressed.
/UUncompresses the specified files. Directories will be marked so that files added afterward will not be compressed.
/SPerforms the specified operation on files in the given directory and all subdirectories. Default dir is the current directory.
/ADisplays files with the hidden or system attributes. These files are omitted by default.
/IContinues performing the specified operation even after errors have occurred. By default, COMPACT stops when an error is encountered.
/FForces the compress operation on all specified files, even those which are already compressed. Already-compressed files are skipped by default.
/QReports only the most essential information.
filenameSpecifies a pattern, file, or directory.

Used without parameters, COMPACT displays the compression state of the current directory and any files it contains. You may use multiple filenames and wildcards. You must put spaces between multiple parameters.

CONVERT [+Server 2003|+XP]

Converts a FAT volume to NTFS.

CONVERT volume /FS:NTFS [/V] [/CvtArea:filename] [/NoSecurity] [/X]

volumeSpecifies the drive letter (followed by a colon), mount point, or volume name.
/FS:NTFSSpecifies that the volume will be converted to NTFS.
/VSpecifies that Convert will be run in verbose mode.
/CvtArea:filenameSpecifies a contiguous file in the root directory that will be the place holder for NTFS system files.
/NoSecuritySpecifies that the security settings on the converted files and directories allow access by all users.
/XForces the volume to dismount first if necessary. All open handles to the volume will not be valid.

COPY [+Server 2003|+XP]

Copies one or more files to another location.

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/L] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]]

sourceSpecifies the file or files to be copied.
/AIndicates an ASCII text file.
/BIndicates a binary file.
/DAllow the destination file to be created decrypted
destinationSpecifies the directory and/or filename for the new file(s).
/VVerifies that new files are written correctly.
/NUses short filename, if available, when copying a file with a non-8dot3 name.
/YSuppresses prompting to confirm you want to overwrite an existing destination file.
/-YCauses prompting to confirm you want to overwrite an existing destination file.
/ZCopies networked files in restartable mode.
/LIf the source is a symbolic link, copy the link to the target instead of the actual file the source link points to.

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).

Use ROBOCOPY instead

CSVDE [+Server 2003]

Imports and exports data from Active Directory Domain Services (AD DS) using files that store data in the comma-separated value (CSV) format. You can also support batch operations based on the CSV file format standard.

CSVDE [-i] [-f <FileName>] [-s <ServerName>] [-c <String1> <String2>] [-v] [-j <Path>] [-t <PortNumber>] [-d <BaseDN>] [-r <LDAPFilter>] [-p <Scope>] [-l <LDAPAttributeList>] [-o <LDAPAttributeList>] [-g] [-m] [-n] [-k] [-a <UserDistinguishedName> {<Password> | *}] [-b <UserName> <Domain> {<Password> | *}]

volumeSpecifies the drive letter (followed by a colon), mount point, or volume name.
/iSpecifies import mode. If not specified, the default mode is export.
/f <FileName>Identifies the import or export file name.
/s <ServerName>Specifies the domain controller to perform the import or export operation.
/c <String1> <String2>Replaces all occurrences of String1 with String2. You use this parameter when you import data from one domain to another and you want to replace the distinguished name of the export domain (String1) with the distinguished name of the import domain (String2).
/vSets verbose mode.
/j <Path>Sets the log file location. The default is the current path.
/t <PortNumber>Specifies an LDAP port. The default LDAP port is 389. The global catalog port is 3268.
/uSpecifies Unicode format.
/d <BaseDN>Sets the distinguished name of the search base for data export.
/r <PortNumber>Creates an LDAP search filter for data export.
/p <Scope>Sets the search scope. Search scope options are Base, OneLevel, or SubTree.
/l <LDAPAttributeList>Sets the list of attributes to return in the results of an export query. LDAP can return attributes in any order, and csvde does not attempt to impose any order on the columns. If you omit this parameter, AD DS returns all attributes.
/o <LDAPAttributeList>Specifies the list of attributes to omit from the results of an export query. You use this parameter if you need to export objects from AD DS, and then import them into another LDAP-compliant directory. If the other directory does not support certain attributes, you can use this parameter to omit those attributes from the result set.
/gOmits paged searches.
/mOmits attributes that apply only to Active Directory objects, such as the ObjectGUID, objectSID, pwdLastSet, and samAccountType attributes.
/nOmits the export of binary values.
/kIgnores errors during an import operation and continues processing. The following is a complete list of ignored errors:
- Object already exists
- Constraint violation
- Attribute or value already exists
/a [<UserDistinguishedName> {<Password> | *}]Performs a simple LDAP bind with the user name and password. Sets the command to run using the supplied UserDistinguishedName and Password. By default, the command runs using the credentials of the user who is currently logged on to the network.
/b [<UserName> <Domain> {<Password> | *}]Performs a secure LDAP bind with the NEGOTIATE authentication method. Sets the command to run using the supplied Username, Domain, and Password. By default, the command will run using the credentials of the user who is currently logged on to the network.
/?Displays Help at the command prompt.

D

DATE

Displays or sets the date.

DATE [/T | date]

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.

DEFRAG

Availability: +Windows 2000 Professional | +Windows 2000 Server

Description: Locates and consolidates fragmented files on local volumes to improve system performance.

Syntax:

defrag <volume> -a [-v]

defrag <volume> [{-r | -w}] [-f] [-v]

defrag -c [{-r | -w}] [-f] [-v]

Parameters:

<volume>Specifies the drive letter or mount point path of the volume to be defragmented or analyzed.
-cDefragments all volumes on this computer.
-aPerforms fragmentation analysis only.
-rPerforms partial defragmentation (default). Attempts to consolidate only fragments smaller than 64 megabytes (MB).
-wPerforms full defragmentation. Attempts to consolidate all file fragments, regardless of their size. (V+)
-fForces defragmentation of the volume when free space is low.
-vSpecifies verbose mode. The defragmentation and analysis output is more detailed.
-?Displays this help information.

Examples: defrag d: ; defrag d:\vol\mountpoint -w -f ; defrag d: -a -v ; defrag -c -v

DEL, ERASE

Deletes one or more files.

DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

namesSpecifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted.
/PPrompts for confirmation before deleting each file.
/FForce deleting of read-only files.
/SDelete specified files from all subdirectories.
/QQuiet mode, do not ask if OK to delete on global wildcard
/ASelects files to delete based on attributes
attributesRRead-only filesSSystem files
HHidden filesAFiles ready for archiving
INot content indexed FilesLReparse Points
-Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

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.

DIR

Displays a list of files and subdirectories in a directory.

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

[drive:][path][filename]Specifies drive, directory, and/or files to list.
/ADisplays files with specified attributes.
attributesDDirectoriesRRead-only files
HHidden filesAFiles ready for archiving
SSystem filesINot content indexed files
LReparse Points-Prefix meaning not
/B Uses bare format (no heading information or summary).
/CDisplay the thousand separator in file sizes. This is the default. Use /-C to disable display of separator.
/DSame as wide but files are list sorted by column.
/LUses lowercase.
/NNew long list format where filenames are on the far right.
/OList by files in sorted order.
sortorderNBy name (alphabetic)SBy size (smallest first)
EBy extension (alphabetic)DBy date/time (oldest first)
GGroup directories first-Prefix to reverse order
/PPauses after each screenful of information.
/QDisplay the owner of the file.
/RDisplay alternate data streams of the file.
/SDisplays files in specified directory and all subdirectories.
/TControls which time field displayed or used for sorting
timefieldCCreation
ALast Access
WLast Written
/WUses wide list format.
/XThis 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.
/4Displays four-digit years

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

DISKCOMP

Compares the contents of two floppy disks.

DISKCOMP [drive1: [drive2:]]

DISKCOPY

Copies the contents of one floppy disk to another.

DISKCOPY [drive1: [drive2:]] [/V]

/VVerifies that the information is copied correctly.

The two floppy disks must be the same type.

You may specify the same drive for drive1 and drive2.

DISKPART

Microsoft DiskPart version 6.0.6002

Copyright (C) 1999-2007 Microsoft Corporation.

On computer: %hostname%

DISKPART>

Microsoft DiskPart version 6.0.6002

ACTIVE- Mark the selected basic partition as active.
ADD- Add a mirror to a simple volume.
ASSIGN- Assign a drive letter or mount point to the selected volume.
ATTRIBUTES- Manipulate volume or disk attributes.
AUTOMOUNT- Enable and disable automatic mounting of basic volumes.
BREAK- Break a mirror set.
CLEAN- Clear the configuration information, or all information, off the disk.
CONVERT- Convert between different disk formats.
CREATE- Create a volume or partition.
DELETE- Delete an object.
DETAIL- Provide details about an object.
EXIT- Exit DiskPart.
EXTEND- Extend a volume.
FILESYSTEMS- Display current and supported file systems on the volume.
FORMAT- Format the volume or partition.
GPT- Assign attributes to the selected GPT partition.
HELP- Display a list of commands.
IMPORT- Import a disk group.
INACTIVE- Mark the selected basic partition as inactive.
LIST- Display a list of objects.
ONLINE- Online an object that is currently marked as offline.
OFFLINE- Offline an object that is currently marked as online.
RECOVER- Refreshes the state of all disks in the selected pack. Attempts recovery on disks in the invalid pack, and resynchronizes mirrored volumes and RAID5 volumes that have stale plex or parity data.
REM- Does nothing. This is used to comment scripts.
REMOVE- Remove a drive letter or mount point assignment.
REPAIR- Repair a RAID-5 volume with a failed member.
RESCAN- Rescan the computer looking for disks and volumes.
RETAIN- Place a retained partition under a simple volume.
SAN- Display or set the SAN policy for the currently booted OS.
SELECT- Shift the focus to an object.
SETID- Change the partition type.
SHRINK- Reduce the size of the selected volume.
UNIQUEID- Displays or sets the GUID partition table (GPT) identifier or master boot record (MBR) signature of a disk.

DISKPART>

Leaving DiskPart...

DOSKEY

Edits command lines, recalls Windows commands, and creates macros.

DOSKEY [/REINSTALL] [/LISTSIZE=size] [/MACROS[:ALL | :exename]] [/HISTORY] [/INSERT | /OVERSTRIKE] [/EXENAME=exename] [/MACROFILE=filename] [macroname=[text]]

/REINSTALLInstalls a new copy of Doskey.
/LISTSIZE=sizeSets size of command history buffer.
/MACROSDisplays all Doskey macros.
/MACROS:ALLDisplays all Doskey macros for all executables which have Doskey macros.
/MACROS:exenameDisplays all Doskey macros for the given executable.
/HISTORYDisplays all commands stored in memory.
/INSERTSpecifies that new text you type is inserted in old text.
/OVERSTRIKESpecifies that new text overwrites old text.
/EXENAME=exenameSpecifies the executable.
/MACROFILE=filenameSpecifies a file of macros to install.
macronameSpecifies a name for a macro you create.
textSpecifies commands you want to record.

UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays command history; ALT+F7 clears command history; F8 searches command history; F9 selects a command by number; ALT+F10 clears macro definitions.

The following are some special codes in Doskey macro definitions:

$TCommand separator. Allows multiple commands in a macro.
$1-$9Batch parameters. Equivalent to %1-%9 in batch programs.
$*Symbol replaced by everything following macro name on command line.

DRIVERQUERY

DRIVERQUERY [/S system [/U username [/P [password]]]] [/FO format] [/NH] [/SI] [/V]

Description: Enables an administrator to display a list of installed device drivers.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specify the password for the given user context.
/FO formatSpecifies the type of output to display. Valid values to be passed with the switch are "TABLE", "LIST", "CSV".
/NHSpecifies that the "Column Header" should not be displayed. Valid for "TABLE" and "CSV" format only.
/SIProvides information about signed drivers.
/VDisplays verbose output. Not valid for signed drivers.
/?Displays this help message.

Examples: DRIVERQUERY ; DRIVERQUERY /FO CSV /SI ; DRIVERQUERY /NH ; DRIVERQUERY /S ipaddress /U user /V ;

DRIVERQUERY /S system /U domain\user /P password /FO LIST

DXDIAG

DirectX Diagnostic Tool

Usage: dxdiag [/whql:on | /whql:off] [/64bit] [/x outfile] [/t outfile]

/x outfilesilently save XML information to <outfile> and quit
/t outfilesilently save txt information to <outfile> and quit
/whql:onallow dxdiag to check for WHQL digital signatures
/whql:offdo not allow dxdiag to check for WHQL digital signatures
/64bitLaunch 64-bit dxdiag
/?Displays pop-up help message

Note: Checking for WHQL digital signatures may connect via internet to update WHQL certificates.

E

ECHO

Displays messages, or turns command-echoing on or off.

ECHO[ON | OFF]
ECHO[message]

Type ECHO without parameters to display the current echo setting.

ENDLOCAL

Ends localization of environment changes in a batch file.

Environment changes made after ENDLOCAL has been issued are not local to the batch file; the previous settings are not restored on termination of the batch file.

ENDLOCAL

If Command Extensions are enabled ENDLOCAL changes as follows:

If the corresponding SETLOCAL enabled or disabled command extensions using the new ENABLEEXTENSIONS or DISABLEEXTENSIONS options, then after the ENDLOCAL, the enabled/disabled state of command extensions will be restored to what it was prior to the matching SETLOCAL command execution.

ERASE

See DEL.

EVENTCREATE

EVENTCREATE [/S system [/U username [/P [password]]]] /ID eventid [/L logname] [/SO srcname] /T type /D description

Description: This command line tool enables an administrator to create a custom event ID and message in a specified event log.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specifies the password for the given user context. Prompts for input if omitted.
/L lognameSpecifies the event log to create an event in.
/T typeSpecifies the type of event to create. Valid types: SUCCESS, ERROR, WARNING, INFORMATION.
/SO sourceSpecifies the source to use for the event (if not specified, source will default to 'eventcreate'). A valid source can be any string and should represent the application or component that is generating the event.
/ID idSpecifies the event ID for the event. A valid custom message ID is in the range of 1 - 1000.
/D descriptionSpecifies the description text for the new event.
/?Displays this help message.

Examples:

EVENTCREATE /T ERROR /ID 1000 /L APPLICATION /D "My custom error event for the application log"

EVENTCREATE /T ERROR /ID 999 /L APPLICATION /SO WinWord /D "Winword event 999 happened due to low diskspace"

EVENTCREATE /S system /T ERROR /ID 100 /L APPLICATION /D "Custom job failed to install"

EVENTCREATE /S system /U user /P password /ID 1 /T ERROR /L APPLICATION /D "User access failed due to invalid user credentials"

EXIT

Quits the CMD.EXE program (command interpreter) or the current batch script.

EXIT [/B] [exitCode]

/Bspecifies to exit the current batch script instead of CMD.EXE. If executed from outside a batch script, it will quit CMD.EXE
exitCodespecifies a numeric number. if /B is specified, sets ERRORLEVEL to that number. If quitting CMD.EXE, sets the process exit code with that number.

EXPAND

Microsoft (R) File Expansion Utility Version 6.0.6001.18000

Copyright (c) Microsoft Corporation. All rights reserved.

Expands one or more compressed files.

EXPAND [-r] Source Destination

EXPAND -r Source [Destination]

EXPAND -D Source.cab [-F:Files]

EXPAND Source.cab -F:Files Destination

-rRename expanded files.
-DDisplay list of files in source.
SourceSource file specification. Wildcards may be used.
-F:FilesName of files to expand from a .CAB.
DestinationDestination file | path specification. Destination may be a directory. If Source is multiple files and -r is not specified, Destination must be a directory.

F

FC

Availability: +Windows 2000 Professional | +Windows 2000 Server

Compares two files or sets of files and displays the differences between them.

FC [/A] [/C] [/L] [/LBn] [/N] [/OFF[LINE]] [/T] [/U] [/W] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2

FC /B [drive1:][path1]filename1 [drive2:][path2]filename2

/ADisplays only first and last lines for each set of differences.
/BPerforms a binary comparison.
/CDisregards the case of letters.
/LCompares files as ASCII text.
/LBnSets the maximum consecutive mismatches to the specified number of lines.
/NDisplays the line numbers on an ASCII comparison.
/OFF[LINE]Do not skip files with offline attribute set.
/TDoes not expand tabs to spaces.
/UCompare files as UNICODE text files.
/WCompresses white space (tabs and spaces) for comparison.
/nnnnSpecifies the number of consecutive lines that must match after a mismatch.
[drive1:][path1]filename1Specifies the first file or set of files to compare.
[drive2:][path2]filename2Specifies the second file or set of files to compare.

FIND

Availability: +Windows 2000 Professional | +Windows 2000 Server

Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]

/VDisplays all lines NOT containing the specified string.
/CDisplays only the count of lines containing the string.
/NDisplays line numbers with the displayed lines.
/IIgnores the case of characters when searching for the string.
/OFF[LINE]Do not skip files with offline attribute set.
"string"Specifies the text string to find.
[drive:][path]filenameSpecifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt or piped from another command.

FINDSTR

Availability: +Windows 2000 Professional | +Windows 2000 Server

Searches for strings in files.

FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file] [/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]] strings [[drive:][path]filename[ ...]]

/BMatches pattern if at the beginning of a line.
/EMatches pattern if at the end of a line.
/LUses search strings literally.
/RUses search strings as regular expressions.
/SSearches for matching files in the current directory and all subdirectories.
/ISpecifies that the search is not to be case-sensitive.
/XPrints lines that match exactly.
/VPrints only lines that do not contain a match.
/NPrints the line number before each line that matches.
/MPrints only the filename if a file contains a match.
/OPrints character offset before each matching line.
/PSkip files with non-printable characters.
/OFF[LINE]Do not skip files with offline attribute set.
/A:attrSpecifies color attribute with two hex digits. See color /?
/F:fileReads file list from the specified file(/ stands for console).
/C:stringUses specified string as a literal search string.
/G:fileGets search strings from the specified file(/ stands for console).
/D:dirSearch a semicolon delimited list of directories
stringsText to be searched for.
[drive:][path]filenameSpecifies a file or files to search.

Use spaces to separate multiple search strings unless the argument is prefixed with /C. For example, 'FINDSTR "hello there" x.y' searches for "hello" or "there" in file x.y. 'FINDSTR /C:"hello there" x.y' searches for "hello there" in file x.y.

Regular expression quick reference:

.Wildcard: any character
*Repeat: zero or more occurrences of previous character or class
^Line position: beginning of line
$Line position: end of line
[class]Character class: any one character in set
[^class]Inverse class: any one character not in set
[x-y]Range: any characters within the specified range
\xEscape: literal use of metacharacter x
\<xyzWord position: beginning of word
xyz\>Word position: end of word

For full information on FINDSTR regular expressions refer to the online Command Reference.

More details/examples here <http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/findstr.mspx>

FINGER

Availability: +Windows 2000 Professional | +Windows 2000 Server

Displays information about a user on a specified system running the Finger service. Output varies based on the remote system.

FINGER [-l] [user]@host [...]

-lDisplays information in long list format.
userSpecifies the user you want information about. Omit the user parameter to display information about all users on the specified host.
@hostSpecifies the server on the remote system whose users you want information about.

FOR

Availability: +Windows 2000 Professional | +Windows 2000 Server

Runs a specified command for each file in a set of files.

FOR %variable IN (set) DO command [command-parameters]

%variableSpecifies a single letter replaceable parameter.
(set)Specifies a set of one or more files. Wildcards may be used.
commandSpecifies the command to carry out for each file.
command-parametersSpecifies parameters or switches for the specified command.

To use the FOR command in a batch program, specify %%variable instead of %variable. Variable names are case sensitive, so %i is different from %I.

If Command Extensions are enabled, the following additional forms of the FOR command are supported:

FOR /D %variable IN (set) DO command [command-parameters]

If set contains wildcards, then specifies to match against directory names instead of file names.

FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]

Walks the directory tree rooted at [drive:]path, executing the FOR statement in each directory of the tree. If no directory specification is specified after /R then the current directory is assumed. If set is just a single period (.) character then it will just enumerate the directory tree.

FOR /L %variable IN (start,step,end) DO command [command-parameters]

The set is a sequence of numbers from start to end, by step amount. So (1,1,5) would generate the sequence 1 2 3 4 5 and (5,-1,1) would generate the sequence (5 4 3 2 1)

FOR /F ["options"] %variable IN (file-set) DO command [command-parameters]

FOR /F ["options"] %variable IN ("string") DO command [command-parameters]

FOR /F ["options"] %variable IN ('command') DO command [command-parameters]

or, if usebackq option present:

FOR /F ["options"] %variable IN (file-set) DO command [command-parameters]

FOR /F ["options"] %variable IN ('string') DO command [command-parameters]

FOR /F ["options"] %variable IN (`command`) DO command [command-parameters]

file-set is one or more file names. Each file is opened, read and processed before going on to the next file in file-set. Processing consists of reading in the file, breaking it up into individual lines of text and then parsing each line into zero or more tokens. The body of the for loop is then called with the variable value(s) set to the found token string(s). By default, /F passes the first blank separated token from each line of each file. Blank lines are skipped. You can override the default parsing behavior by specifying the optional "options" parameter. This is a quoted string which contains one or more keywords to specify different parsing options. The keywords are:

eol=c- specifies an end of line comment character (just one)
skip=n- specifies the number of lines to skip at the beginning of the file.
delims=xxx- specifies a delimiter set. This replaces the default delimiter set of space and tab.
tokens=x,y,m-n- specifies which tokens from each line are to be passed to the for body for each iteration. This will cause additional variable names to be allocated. The m-n form is a range, specifying the mth through the nth tokens. If the last character in the tokens= string is an asterisk, then an additional variable is allocated and receives the remaining text on the line after the last token parsed.
usebackq- specifies that the new semantics are in force, where a back quoted string is executed as a command and a single quoted string is a literal string command and allows the use of double quotes to quote file names in filenameset.

Some examples might help:

FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do @echo %i %j %k

would parse each line in myfile.txt, ignoring lines that begin with a semicolon, passing the 2nd and 3rd token from each line to the for body, with tokens delimited by commas and/or spaces. Notice the for body statements reference %i to get the 2nd token, %j to get the 3rd token, and %k to get all remaining tokens after the 3rd. For file names that contain spaces, you need to quote the filenames with double quotes. In order to use double quotes in this manner, you also need to use the usebackq option, otherwise the double quotes will be interpreted as defining a literal string to parse.

%i is explicitly declared in the for statement and the %j and %k are implicitly declared via the tokens= option. You can specify up to 26 tokens via the tokens= line, provided it does not cause an attempt to declare a variable higher than the letter 'z' or 'Z'. Remember, FOR variables are single-letter, case sensitive, global, and you can't have more than 52 total active at any one time.

You can also use the FOR /F parsing logic on an immediate string, by making the filenameset between the parenthesis a quoted string, using single quote characters. It will be treated as a single line of input from a file and parsed.

Finally, you can use the FOR /F command to parse the output of a command. You do this by making the filenameset between the parenthesis a back quoted string. It will be treated as a command line, which is passed to a child CMD.EXE and the output is captured into memory and parsed as if it was a file. So the following example:

FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i

would enumerate the environment variable names in the current environment.

In addition, substitution of FOR variable references has been enhanced. You can now use the following optional syntax:

%~I- expands %I removing any surrounding quotes (")
%~fI- expands %I to a fully qualified path name
%~dI- expands %I to a drive letter only
~pI- expands %I to a path only
~nI- expands %I to a file name only
~xI- expands %I to a file extension only
~sI- expanded path contains short names only
~aI- expands %I to file attributes of file
%~tI- expands %I to date/time of file
%~zI- expands %I to size of file
%~$PATH:I- searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, then this modifier expands to the empty string

The modifiers can be combined to get compound results:

%~dpI- expands %I to a drive letter and path only
%~nxI- expands %I to a file name and extension only
%~fsI- expands %I to a full path name with short names only
%~dp$PATH:I- searches the directories listed in the PATH environment variable for %I and expands to the drive letter and path of the first one found.
%~ftzaI- expands %I to a DIR like output line

In the above examples %I and PATH can be replaced by other valid values. The %~ syntax is terminated by a valid FOR variable name. Picking upper case variable names like %I makes it more readable and avoids confusion with the modifiers, which are not case sensitive.

FORFILES

Availability: +Windows Vista | +Windows Server 2003

FORFILES [/P pathname] [/M searchmask] [/S] [/C command] [/D [+ | -] {dd/MM/yyyy | dd}]

Description: Selects a file (or set of files) and executes a command on that file. This is helpful for batch jobs.

Parameter List:

/P pathnameIndicates the path to start searching. The default folder is the current working directory (.).
/M searchmaskSearches files according to a searchmask. The default searchmask is '*' .
/SInstructs forfiles to recurse into subdirectories. Like "DIR /S".
/C commandIndicates the command to execute for each file. Command strings should be wrapped in double quotes. The default command is "cmd /c echo @file".
The following variables can be used in the command string:
@file - returns the name of the file.
@fname - returns the file name without extension.
@ext - returns only the extension of the file.
@path - returns the full path of the file.
@relpath - returns the relative path of the file.
@isdir - returns "TRUE" if a file type is a directory, and "FALSE" for files.
@fsize - returns the size of the file in bytes.
@fdate - returns the last modified date of the file.
@ftime - returns the last modified time of the file.

To include special characters in the command line, use the hexadecimal code for the character in 0xHH format (ex. 0x09 for tab). Internal CMD.exe commands should be preceded with "cmd /c".
/D dateSelects files with a last modified date greater than or equal to (+), or less than or equal to (-), the specified date using the "dd/MM/yyyy" format; or selects files with a last modified date greater than or equal to (+) the current date plus "dd" days, or less than or equal to (-) the current date minus "dd" days. A valid "dd" number of days can be any number in the range of 0 - 32768.
"+" is taken as default sign if not specified.
/?Displays this help message.

Examples:

FORFILES /?

FORFILES

FORFILES /P C:\WINDOWS /S /M DNS*.*

FORFILES /S /M *.txt /C "cmd /c type @file | more"

FORFILES /P C:\ /S /M *.bat

FORFILES /D -30 /M *.exe /C "cmd /c echo @path 0x09 was changed 30 days ago"

FORFILES /D 01/01/2001 /C "cmd /c echo @fname is new since Jan 1st 2001"

FORFILES /D +29/5/2012 /C "cmd /c echo @fname is new today"

FORFILES /M *.exe /D +1

FORFILES /S /M *.doc /C "cmd /c echo @fsize"

FORFILES /M *.txt /C "cmd /c if @isdir==FALSE notepad.exe @file"

FORMAT

Availability: +Windows 2000 Professional | +Windows 2000 Server

Formats a disk for use with Windows.

FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X] [/P:passes]

FORMAT volume [/V:label] [/Q] [/F:size] [/P:passes]

FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors] [/P:passes]

FORMAT volume [/V:label] [/Q] [/P:passes]

FORMAT volume [/Q]

volumeSpecifies the drive letter (followed by a colon), mount point, or volume name.
/FS:filesystemSpecifies the type of the file system (FAT, FAT32, exFAT, NTFS, or UDF).
/V:labelSpecifies the volume label.
/QPerforms a quick format. Note that this switch overrides /P.
/CNTFS only: Files created on the new volume will be compressed by default.
/XForces the volume to dismount first if necessary. All opened handles to the volume would no longer be valid.
/R:revisionUDF only: Forces the format to a specific UDF version (1.02, 1.50, 2.00, 2.01, 2.50). The default revision is 2.01.
/DUDF 2.50 only: Metadata will be duplicated.
/A:sizeOverrides the default allocation unit size. Default settings are strongly recommended for general use.
NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).
FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).
exFAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M.
Note that the FAT and FAT32 files systems impose the following restrictions on the number of clusters on a volume:
FAT: Number of clusters <= 65526
FAT32: 65526 < Number of clusters < 4177918
Format will immediately stop processing if it decides that the above requirements cannot be met using the specified cluster size.
NTFS compression is not supported for allocation unit sizes above 4096.
/F:sizeSpecifies the size of the floppy disk to format (1.44).
/T:tracksSpecifies the number of tracks per disk side.
/N:sectorsSpecifies the number of sectors per track.
/P:passesZero every sector on the volume passes times. This switch is not valid with /Q.

FSUTIL

---- Commands Supported ----

behaviorControl file system behavior
dirtyManage volume dirty bit
fileFile specific commands
fsinfoFile system information
hardlinkHardlink management
objectidObject ID management
quotaQuota management
repairSelf healing management
reparsepointReparse point management
resourceTransactional Resource Manager management
sparseSparse file control
transactionTransaction management
usnUSN management
volumeVolume management

fsutil behavior

---- BEHAVIOR Commands Supported ----

queryQuery the file system behavior parameters
setChange the file system behavior parameters

fsutil behavior query

Usage: fsutil behavior query <option>

<option>

AllowExtChar

BugcheckOnCorrupt

Disable8dot3 [<Volume Path>]

DisableCompression

DisableEncryption

DisableLastAccess

EncryptPagingFile

MftZone

MemoryUsage

QuotaNotify

SymlinkEvaluation

DisableDeleteNotify

fsutil dirty

---- DIRTY Commands Supported ----

queryQuery the dirty bit
setSet the dirty bit

fsutil file

---- FILE Commands Supported ----

findbysidFind a file by security identifier
queryallocrangesQuery the allocated ranges for a file
setshortnameSet the short name for a file
setvaliddataSet the valid data length for a file
setzerodataSet the zero data for a file
createnewCreates a new file of a specified size

fsutil fsinfo

---- FSINFO Commands Supported ----

drivesList all drives
drivetypeQuery drive type for a drive
volumeinfoQuery volume information
ntfsinfoQuery NTFS specific volume information
statisticsQuery file system statistics

fsutil fsinfo drives

Usage : fsutil fsinfo drives

fsutil fsinfo drivetype

Usage : fsutil fsinfo drivetype <volume pathname>

Eg : fsutil fsinfo drivetype C:

fsutil hardlink

---- HARDLINK Commands Supported ----

createCreate a hardlink

fsutil hardlink create

Usage : fsutil hardlink create <new filename> <existing filename>

Eg : fsutil hardlink create c:\foo.txt c:\bar.txt

Please use "fsutil 8dot3name query /?" for more information.

FTP

Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]

-vSuppresses display of remote server responses.
-nSuppresses auto-login upon initial connection.
-iTurns off interactive prompting during multiple file transfers.
-dEnables debugging.
-gDisables filename globbing (see GLOB command).
-s:filenameSpecifies a text file containing FTP commands; the commands will automatically run after FTP starts.
-aUse any local interface when binding data connection.
-Alogin as anonymous.
-x:send sockbufOverrides the default SO_SNDBUF size of 8192.
-r:recv sockbufOverrides the default SO_RCVBUF size of 8192.
-b:async countOverrides the default async count of 3
-w:windowsizeOverrides the default transfer buffer size of 65535.
hostSpecifies the host name or IP address of the remote host to connect to.

Notes:

- mget and mput commands take y/n/q for yes/no/quit.

- Use Control-C to abort commands.

FTYPE

Displays or modifies file types used in file extension associations

FTYPE [fileType[=[openCommandString]]]

fileTypeSpecifies the file type to examine or change
openCommandStringSpecifies the open command to use when launching files of this type.

Type FTYPE without parameters to display the current file types that have open command strings defined. FTYPE is invoked with just a file type, it displays the current open command string for that file type. Specify nothing for the open command string and the FTYPE command will delete the open command string for the file type. Within an open command string %0 or %1 are substituted with the file name being launched through the assocation. %* gets all the parameters and %2 gets the 1st parameter, %3 the second, etc. %~n gets all the remaining parameters starting with the nth parameter, where n may be between 2 and 9, inclusive. For example:

ASSOC .pl=PerlScript

FTYPE PerlScript=perl.exe %1 %*

would allow you to invoke a Perl script as follows: script.pl 1 2 3

If you want to eliminate the need to type the extensions, then do the following: set PATHEXT=.pl;%PATHEXT%

and the script could be invoked as follows: script 1 2 3

G

GETMAC

GETMAC [/S system [/U username [/P [password]]]] [/FO format] [/NH] [/V]

Description: This tool enables an administrator to display the MAC address for network adapters on a system.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specifies the password for the given user context. Prompts for input if omitted.
/FO formatSpecifies the format in which the output is to be displayed. Valid values: "TABLE", "LIST", "CSV".
/NHSpecifies that the "Column Header" should not be displayed in the output. Valid only for TABLE and CSV formats.
/VSpecifies that verbose information is displayed.
/?Displays this help message.

Examples: GETMAC /? ; GETMAC /FO CSV ; GETMAC /S system /NH /V ; GETMAC /S system /U user ;

GETMAC /S system /U domain\user /P password /FO list /V ; GETMAC /S system /U domain\user /P password /FO table /NH

GOTO

Directs cmd.exe to a labeled line in a batch program.

GOTO label

labelSpecifies a text string used in the batch program as a label.

You type a label on a line by itself, beginning with a colon.

If Command Extensions are enabled GOTO changes as follows:

GOTO command now accepts a target label of :EOF which transfers control to the end of the current batch script file. This is an easy way to exit a batch script file without defining a label. Type CALL /? for a description of extensions to the CALL command that make this feature useful.

GPRESULT

GPRESULT [/S system [/U username [/P [password]]]] [/SCOPE scope] [/USER targetusername] [/R | /V | /Z] [(/X | /H) <filename> [/F]]

Description: This command line tool displays the Resultant Set of Policy (RSoP) information for a target user and computer.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute. Can not be used with /X, /H.
/P [password]Specifies the password for the given user context. Prompts for input if omitted. Can not be used with /X, /H.
/SCOPE scopeSpecifies whether the user or the computer settings needs to be displayed. Valid values: "USER", "COMPUTER".
/USER [domain\]userSpecifies the user name for which the RSoP data is to be displayed.
/X <filename>Saves the report in XML format at the location and with the file name specified by the filename parameter. (valid in Windows Vista SP1 and Windows Server 2008)
/H <filename>Saves the report in HTML format at the location and with the file name specified by the filename parameter. (valid in Windows Vista SP1 and Windows Server 2008)
/FForces gpresult to overwrite the file name specified in the /X or /H command.
/RDisplays RSoP summary data.
/VSpecifies that verbose information should be displayed. Verbose information provides additional detailed settings that have been applied with a precedence of 1.
/ZSpecifies that the super-verbose information should be displayed. Super-verbose information provides additional detailed settings that have been applied with a precedence of 1 and higher. This allows you to see if a setting was set in multiple places. See the Group Policy online help topic for more information.
/?Displays this help message.

Examples: GPRESULT /R ; GPRESULT /H GPReport.html ; GPRESULT /USER targetusername /V ;

GPRESULT /S system /USER targetusername /SCOPE COMPUTER /Z ; GPRESULT /S system /U username /P password /SCOPE USER /V

GPUPDATE

Description: Updates Group Policies settings.

Syntax: GPUpdate [/Target:{Computer | User}] [/Force] [/Wait:<value>] [/Logoff] [/Boot] [/Sync]

Parameters:

/Target:{Computer | User}Specifies that only User or only Computer policy settings are updated. By default, both User and Computer policy settings are updated.
/ForceReapplies all policy settings. By default, only policy settings that have changed are applied.
/Wait:{value}Sets the number of seconds to wait for policy processing to finish. The default is 600 seconds. The value '0' means not to wait. The value '-1' means to wait indefinitely. When the time limit is exceeded, the command prompt returns, but policy processing continues.
/LogoffCauses a logoff after the Group Policy settings have been updated. This is required for those Group Policy client-side extensions that do not process policy on a background update cycle but do process policy when a user logs on. Examples include user-targeted Software Installation and Folder Redirection. This option has no effect if there are no extensions called that require a logoff.
/BootCauses a computer restart after the Group Policy settings are applied. This is required for those Group Policy client-side extensions that do not process policy on a background update cycle but do process policy at computer startup. Examples include computer-targeted Software Installation. This option has no effect if there are no extensions called that require a restart.
/SyncCauses the next foreground policy application to be done synchronously. Foreground policy applications occur at computer boot and user logon. You can specify this for the user, computer or both using the /Target parameter. The /Force and /Wait parameters will be ignored if specified.

GRAFTABL

Enable Windows to display an extended character set in graphics mode.

GRAFTABL [xxx]

GRAFTABL /STATUS

xxxSpecifies a code page number.
/STATUSDisplays the current code page selected for use with GRAFTABL.

More details here <http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/graftabl.mspx>

H

HELP

Availability: +Windows 2000 Professional | +Windows 2000 Server

Provides help information for Windows commands.

HELP [command]

command- displays help information on that command.

HOSTNAME

Availability: +Windows 2000 Professional | +Windows 2000 Server

Prints the name of the current host.

hostname

I

ICACLS

ICACLS name /save aclfile [/T] [/C] [/L] [/Q] stores the DACLs for the files and folders that match the name into aclfile for later use with /restore. Note that SACLs, owner, or integrity labels are not saved.

ICACLS directory [/substitute SidOld SidNew [...]] /restore aclfile [/C] [/L] [/Q] applies the stored DACLs to files in directory.

ICACLS name /setowner user [/T] [/C] [/L] [/Q] changes the owner of all matching names. This option does not force a change of ownership; use the takeown.exe utility for that purpose.

ICACLS name /findsid Sid [/T] [/C] [/L] [/Q] finds all matching names that contain an ACL explicitly mentioning Sid.

ICACLS name /verify [/T] [/C] [/L] [/Q] finds all files whose ACL is not in canonical form or whose lengths are inconsistent with ACE counts.

ICACLS name /reset [/T] [/C] [/L] [/Q] replaces ACLs with default inherited ACLs for all matching files.

ICACLS name [/grant[:r] Sid:perm[...]] [/deny Sid:perm [...]] [/remove[:g|:d]] Sid[...]] [/T] [/C] [/L] [/Q] [/setintegritylevel Level:policy[...]]

/grant[:r] Sid:permgrants the specified user access rights. With :r, the permissions replace any previouly granted explicit permissions. Without :r, the permissions are added to any previously granted explicit permissions.
/deny Sid:permexplicitly denies the specified user access rights. An explicit deny ACE is added for the stated permissions and the same permissions in any explicit grant are removed.
/remove[:[g|d]] Sidremoves all occurrences of Sid in the ACL. With :g, it removes all occurrences of granted rights to that Sid. With :d, it removes all occurrences of denied rights to that Sid.
/setintegritylevel [(CI)(OI)]Levelexplicitly adds an integrity ACE to all matching files. The level is to be specified as one of:
L[ow]
M[edium]
H[igh]
Inheritance options for the integrity ACE may precede the level and are applied only to directories.
/inheritance:e|d|re - enables inheritance
d - disables inheritance and copy the ACEs
r - remove all inherited ACEs

Note: Sids may be in either numerical or friendly name form. If a numerical form is given, affix a * to the start of the SID.

/Tindicates that this operation is performed on all matching files/directories below the directories specified in the name.
/Cindicates that this operation will continue on all file errors. Error messages will still be displayed.
/Lindicates that this operation is performed on a symbolic link itself versus its target.
/Qindicates that icacls should supress success messages.

perm is a permission mask and can be specified in one of two forms:

 a comma-separated list in parentheses of specific rights:a sequence of simple rights:
DE- deleteN- no access
RC- read controlF- full access
WDAC- write DACM- modify access
WO- write ownerRX- read and execute access
S- synchronizeR- read-only access
AS- access system securityW- write-only access
MA- maximum allowedD- delete access
GR- generic read
GW- generic write
GE- generic execute
GA- generic all
RD- read data/list directory
WD- write data/add file
AD- append data/add subdirectory
REA- read extended attributes
WEA- write extended attributes
X- execute/traverse
DC- delete child
RA- read attributes
WA- write attributes
inheritance rights may precede either form and are applied only to directories:
(OI)- object inherit
(CI)- container inherit
(IO)- inherit only
(NP)- don't propagate inherit
(I)- permission inherited from parent container

ICACLS preserves the canonical ordering of ACE entries: Explicit denials; Explicit grants; Inherited denials; Inherited grants

Examples:

icacls c:\windows\* /save AclFile /T - Will save the ACLs for all files under c:\windows and its subdirectories to AclFile.

icacls c:\windows\ /restore AclFile - Will restore the Acls for every file within AclFile that exists in c:\windows and its subdirectories.

icacls file /grant Administrator:(D,WDAC) - Will grant the user Administrator Delete and Write DAC permissions to file.

icacls file /grant *S-1-1-0:(D,WDAC) - Will grant the user defined by sid S-1-1-0 Delete and Write DAC permissions to file.

IF

Performs conditional processing in batch programs.

IF [NOT] ERRORLEVEL number command

IF [NOT] string1==string2 command

IF [NOT] EXIST filename command

NOTSpecifies that Windows should carry out the command only if the condition is false.
ERRORLEVEL numberSpecifies a true condition if the last program run returned an exit code equal to or greater than the number specified.
string1==string2Specifies a true condition if the specified text strings match.
EXIST filenameSpecifies a true condition if the specified filename exists.
commandSpecifies the command to carry out if the condition is met. Command can be followed by ELSE command which will execute the command after the ELSE keyword if the specified condition is FALSE.

The ELSE clause must occur on the same line as the command after the IF. For example:

IF EXIST filename. (
  del filename.
) ELSE (
  echo filename. missing.
)

The following would NOT work because the del command needs to be terminated by a newline:

IF EXIST filename. del filename. ELSE echo filename. missing

Nor would the following work, since the ELSE command must be on the same line as the end of the IF command:

IF EXIST filename. del filename.
ELSE echo filename. missing

The following would work if you want it all on one line: IF EXIST filename. (del filename.) ELSE echo filename. missing

If Command Extensions are enabled IF changes as follows:

IF [/I] string1 compare-op string2 command

IF CMDEXTVERSION number command

IF DEFINED variable command

where compare-op may be one of:

EQUequal
NEQnot equal
LSSless than
LEQless than or equal
GTRgreater than
GEQgreater than or equal

and the /I switch, if specified, says to do case insensitive string compares. The /I switch can also be used on the string1==string2 form of IF. These comparisons are generic, in that if both string1 and string2 are both comprised of all numeric digits, then the strings are converted to numbers and a numeric comparison is performed.

The CMDEXTVERSION conditional works just like ERRORLEVEL, except it is comparing against an internal version number associated with the Command Extensions. The first version is 1. It will be incremented by one when significant enhancements are added to the Command Extensions. CMDEXTVERSION conditional is never true when Command Extensions are disabled.

The DEFINED conditional works just like EXISTS except it takes an environment variable name and returns true if the environment variable is defined.

%ERRORLEVEL% will expand into a string representation of the current value of ERRORLEVEL, provided that there is not already an environment variable with the name ERRORLEVEL, in which case you will get its value instead. After running a program, the following illustrates ERRORLEVEL use:

goto answer%ERRORLEVEL%
:answer0
echo Program had return code 0
:answer1
echo Program had return code 1

You can also using the numerical comparisons above: IF %ERRORLEVEL% LEQ 1 goto okay

%CMDCMDLINE% will expand into the original command line passed to CMD.EXE prior to any processing by CMD.EXE, provided that there is not already an environment variable with the name CMDCMDLINE, in which case you will get its value instead.

%CMDEXTVERSION% will expand into a string representation of the current value of CMDEXTVERSION, provided that there is not already an environment variable with the name CMDEXTVERSION, in which case you will get its value instead.

IPCONFIG

USAGE:

ipconfig [/? | /all | /renew [adapter] | /release [adapter] | /flushdns | /displaydns | /registerdns | /showclassid adapter | /setclassid adapter [classid] ]

where

adapterConnection name (wildcard characters * and ? allowed, see examples)

Options:

/?Display this help message.
/allDisplay full configuration information.
/releaseRelease the IP address for the specified adapter.
/renewRenew the IP address for the specified adapter.
/flushdnsPurges the DNS Resolver cache.
/registerdnsRefreshes all DHCP leases and re-registers DNS names.
/displaydnsDisplay the contents of the DNS Resolver Cache.
/showclassidDisplays all the dhcp class IDs allowed for adapter.
/setclassidModifies the dhcp class id.

The default is to display only the IP address, subnet mask and default gateway for each adapter bound to TCP/IP.

For Release and Renew, if no adapter name is specified, then the IP address leases for all adapters bound to TCP/IP will be released or renewed.

For Setclassid, if no ClassId is specified, then the ClassId is removed.

Examples:

> ipconfigShow information
> ipconfig /allShow detailed information
> ipconfig /renewRenew all adapters
> ipconfig /renew EL*Renew any connection that has its name starting with EL
> ipconfig /release *Con*Release all matching connections, e.g. "Local Area Connection 1" or "Local Area Connection 2"

L

LABEL

Availability: +Windows 2000 Professional | +Windows Server 2000

Creates, changes, or deletes the volume label of a disk.

LABEL [drive:][label]

LABEL [/MP] [volume] [label]

drive:Specifies the drive letter of a drive.
labelSpecifies the label of the volume.
/MPSpecifies that the volume should be treated as a mount point or volume name.
volumeSpecifies the drive letter (followed by a colon), mount point, or volume name. If volume name is specified, the /MP flag is unnecessary.

LDIFDE

Availability: +Windows Server 2008 | Res. Kit

LDIF Directory Exchange

General Parameters

-iTurn on Import Mode (The default is Export)
-f filenameInput or Output filename
-s servernameThe server to bind to (Default to DC of computer's domain)
-c FromDN ToDNReplace occurences of FromDN to ToDN If either FromDN or ToDN ends with #attributeName, the attribute value will be looked up in rootDSE and used to replace #attributeName. See example for "Macro expansion in DNs".
-vTurn on Verbose Mode
-j pathLog File Location
-t portPort Number (default = 389)
-uUse Unicode format
-w timeoutTerminate execution if the server takes longer than the specified number of seconds to respond to an operation (default = no timeout specified)
-hEnable SASL layer encryption
-?Help

Export Specific

-d RootDNThe root of the LDAP search (Default to Naming Context)
-r FilterLDAP search filter (Default to "(objectClass=*)")
-p SearchScopeSearch Scope (Base/OneLevel/Subtree)
-l listList of attributes (comma separated) to look for in an LDAP search
-o listList of attributes (comma separated) to omit from input.
-gDisable Paged Search.
-mEnable the SAM logic on export.
-nDo not export binary values
-xInclude deleted objects (tombstones)
-1Retain only the important replPropertyMetadata

Import

-kThe import will go on ignoring 'Constraint Violation' and 'Object Already Exists' errors
-yThe import will use lazy commit for better performance (enabled by default)
-eThe import will not use lazy commit
-q threadsThe import will use the specified number of threads (default is 1)
-zContinue importing irrespective of errors.
-xEnable tombstone reanimation support (passes deleted objects control with ldap modify requests)

Credentials Establishment

Note that if no credentials is specified, LDIFDE will bind as the currently logged on user, using SSPI.

-a UserDN [Password | *]Simple authentication
-b UserName Domain [Password | *]SSPI bind method

Example: Simple import of current domain ldifde -i -f INPUT.LDF

Example: Simple export of current domain ldifde -f OUTPUT.LDF

Example: Export of specific domain with credentials

ldifde -m -f OUTPUT.LDF -b USERNAME DOMAINNAME * -s SERVERNAME -d "cn=users,DC=DOMAINNAME,DC=Microsoft,DC=Com" -r "(objectClass=user)"

Example: Macro expansion in DNs

ldifde -f export.ldf -c "#configurationNamingContext" "cn=configuration,dc=x"

ldifde -i -f import.ldf -c "cn=configuration,dc=x" "#configurationNamingContext"

No log files were written. In order to generate a log file, please specify the log file path via the -j option.

LOGOFF

Availability: +Windows 2000 Professional | +Windows Server 2000

Terminates a session.

LABEL [drive:][label]

sessionnameThe name of the session.
sessionidThe ID of the session.
/SERVER:servernameSpecifies the Terminal server containing the user session to log off (default is current).
/VDisplays information about the actions performed.

M

MAKECAB

Cabinet Maker - Lossless Data Compression Tool

MAKECAB [/V[n]] [/D var=value ...] [/L dir] source [destination]

MAKECAB [/V[n]] [/D var=value ...] /F directive_file [...]

sourceFile to compress.
destinationFile name to give compressed file. If omitted, the last character of the source file name is replaced with an underscore (_) and used as the destination.
/F directivesA file with MakeCAB directives (may be repeated). Refer to Microsoft Cabinet SDK for information on directive_file.
/D var=valueDefines variable with specified value.
/L dirLocation to place destination (default is current directory).
/V[n]Verbosity level (1..3).

MD, MKDIR

Creates a directory.

MKDIR [drive:]path

MD [drive:]path

If Command Extensions are enabled MKDIR changes as follows:

MKDIR creates any intermediate directories in the path, if needed. For example, assume \a does not exist then: mkdir \a\b\c\d is the same as:

mkdir \a
chdir \a
mkdir b
chdir b
mkdir c
chdir c
mkdir d

which is what you would have to type if extensions were disabled.

Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

/DCreates a directory symbolic link. Default is a file symbolic link.
/HCreates a hard link instead of a symbolic link.
/JCreates a Directory Junction.
Linkspecifies the new symbolic link name.
Targetspecifies the path (relative or absolute) that the new link refers to.

MODE

Configures system devices.

Serial port:d MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off] [dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]

Device Status: MODE [device] [/STATUS]

Redirect printing: MODE LPTn[:]=COMm[:]

Select code page: MODE CON[:] CP SELECT=yyy

Code page status: MODE CON[:] CP [/STATUS]

Display mode: MODE CON[:] [COLS=c] [LINES=n]

Typematic rate: MODE CON[:] [RATE=r DELAY=d]

MORE

Displays output one screen at a time.

MORE [/E [/C] [/P] [/S] [/Tn] [+n]] < [drive:][path]filename

command-name | MORE [/E [/C] [/P] [/S] [/Tn] [+n]]

MORE /E [/C] [/P] [/S] [/Tn] [+n] [files]

[drive:][path]filenameSpecifies a file to display one screen at a time.
command-nameSpecifies a command whose output will be displayed.
/EEnable extended features
/CClear screen before displaying page
/PExpand FormFeed characters
/SSqueeze multiple blank lines into a single line
/TnExpand tabs to n spaces (default 8)

Switches can be present in the MORE environment variable.

+nStart displaying the first file at line n
filesList of files to be displayed. Files in the list are separated by blanks.

If extended features are enabled, the following commands are accepted at the -- More -- prompt:

P nDisplay next n lines
S nSkip next n lines
FDisplay next file
QQuit
=Show line number
?Show help line
<space>Display next page
<ret>Display next line

MOVE

Moves files and renames files and directories.

To move one or more files: MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

To rename a directory: MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

[drive:][path]filename1Specifies the location and name of the file or files you want to move.
destinationSpecifies the new location of the file. Destination can consist of a drive letter and colon, a directory name, or a combination. If you are moving only one file, you can also include a filename if you want to rename the file when you move it.
[drive:][path]dirname1Specifies the directory you want to rename.
dirname2Specifies the new name of the directory.
/YSuppresses prompting to confirm you want to overwrite an existing destination file.
/-YCauses prompting to confirm you want to overwrite an existing destination file.

The switch /Y may be present in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless MOVE command is being executed from within a batch script.

MSIEXEC

Windows ® Installer. V 4.5.6002.18005

msiexec /Option <Required Parameter> [Optional Parameter]

Install Options

</package | /i> <Product.msi>Installs or configures a product
/a <Product.msi>Administrative install - Installs a product on the network
/j<u|m> <Product.msi> [/t <TransformList>] [/g <LanguageID>]Advertises a product - m to all users, u to current user
</uninstall | /x> <Product.msi | ProductCode>Uninstalls the product

Display Options

/quietQuiet mode, no user interaction
/passiveUnattended mode - progress bar only
/q[n|b|r|f]Sets user interface level
n - No UI
b - Basic UI
r - Reduced UI
f - Full UI (default)
/help Help information

Restart Options

/norestartDo not restart after the installation is complete
/promptrestartPrompts the user for restart if necessary
/forcerestartAlways restart the computer after installation

Logging Options

/l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <LogFile> i - Status messages
w - Nonfatal warnings
e - All error messages
a - Start up of actions
r - Action-specific records
u - User requests
c - Initial UI parameters
m - Out-of-memory or fatal exit information
o - Out-of-disk-space messages
p - Terminal properties
v - Verbose output
x - Extra debugging information
+ - Append to existing log file
! - Flush each line to the log
* - Log all information, except for v and x options
/log <LogFile>Equivalent of /l* <LogFile>

Update Options

/update <Update1.msp>[;Update2.msp]Applies update(s)
/uninstall <PatchCodeGuid>[;Update2.msp] /package <Product.msi | ProductCode>Remove update(s) for a product

Repair Options

/f[p|e|c|m|s|o|d|a|u|v] <Product.msi | ProductCode>Repairs a product
p - only if file is missing
o - if file is missing or an older version is installed (default)
e - if file is missing or an equal or older version is installed
d - if file is missing or a different version is installed
c - if file is missing or checksum does not match the calculated value
a - forces all files to be reinstalled
u - all required user-specific registry entries (default)
m - all required computer-specific registry entries (default)
s - all existing shortcuts (default)
v - runs from source and recaches local package

Setting Public Properties [PROPERTY=PropertyValue]

Consult the Windows ® Installer SDK for additional documentation on the command line syntax.

Copyright ® Microsoft Corporation. All rights reserved. Portions of this software are based in part on the work of the Independent JPEG Group.

MSTSC

Remote Desktop Connection Usage

MSTSC [<connection file>] [/v:<server[:port]>] [/admin] [/f[ullscreen]] [/w:<width> /h:<height>] [/public] [/span] [/edit "connection file"] [/migrate]

<connection file>Specifies the name of an .rdp file for the connection.
/v:<server[:port]>Specifies the remote computer to which you want to connect.
/adminConnects you to the session for administering a server.
/fStarts Remote Desktop in full-screen mode.
/w:<width>Specifies the width of the Remote Desktop window.
/h:<height>Specifies the height of the Remote Desktop window.
/publicRuns Remote Desktop in public mode.
/spanMatches the remote desktop width and height with the local virtual desktop, spanning across multiple monitors if necessary. To span across monitors, the monitors must all have the same height and be aligned vertically.
/edit "connection file"Opens the specified .rdp connection file for editing.
/migrateMigrates legacy conection files that were created with Client Connection Manager to new .rdp connection files.

N

NBTSTAT

Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).

NBTSTAT [ [-a RemoteName] [-A IP address] [-c] [-n] [-r] [-R] [-RR] [-s] [-S] [interval] ]

-a (adapter status)Lists the remote machine’s name table given its name.
-A (Adapter status)Lists the remote machine’s name table given its IP address.
-c (cache)Lists NBT’s cache of remote [machine] names and their IP addresses.
-n (names)Lists local NetBIOS names.
-r (resolved)Lists names resolved by broadcast and via WINS.
-R (Reload)Purges and reloads the remote cache name table.
-S (Sessions)Lists sessions table with the destination IP addresses.
-s (sessions)Lists sessions table converting destination IP addresses to computer NETBIOS names.
-RR (ReleaseRefresh)Sends Name Release packets to WINS and then, starts Refresh.
RemoteNameRemote host machine name.
IP addressDotted decimal representation of the IP address.
intervalRedisplays selected statistics, pausing interval seconds between each display. Press Ctrl+C to stop redisplaying statistics.

NET

The syntax of this command is:

NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP | PAUSE | PRINT | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]

net use

net view

NETSH

Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password | *] [Command | -f ScriptFile]

The following commands are available:

Commands in this context:

?- Displays a list of commands.
add- Adds a configuration entry to a list of entries.
advfirewall- Changes to the `netsh advfirewall' context.
bridge- Changes to the `netsh bridge' context.
delete- Deletes a configuration entry from a list of entries.
dhcpclient- Changes to the `netsh dhcpclient' context.
dump- Displays a configuration script.
exec- Runs a script file.
firewall- Changes to the `netsh firewall' context.
help- Displays a list of commands.
http- Changes to the `netsh http' context.
interface- Changes to the `netsh interface' context.
ipsec- Changes to the `netsh ipsec' context.
lan- Changes to the `netsh lan' context.
nap- Changes to the `netsh nap' context.
netio- Changes to the `netsh netio' context.
p2p- Changes to the `netsh p2p' context.
ras- Changes to the `netsh ras' context.
rpc- Changes to the `netsh rpc' context.
set- Updates configuration settings.
show- Displays information.
wcn- Changes to the `netsh wcn' context.
winhttp- Changes to the `netsh winhttp' context.
winsock- Changes to the `netsh winsock' context.
wlan- Changes to the `netsh wlan' context.

The following sub-contexts are available:

advfirewall bridge dhcpclient firewall http interface ipsec lan nap netio p2p ras rpc wcn winhttp winsock wlan

To view help for a command, type the command, followed by a space, and then type ?.

O

OPENFILES

OPENFILES /parameter [arguments]

Description: Enables an administrator to list or disconnect files and folders that have been opened on a system.

Parameter List:

/DisconnectDisconnects one or more open files.
/QueryDisplays files opened locally or from shared folders.
/LocalEnables / Disables the display of local open files.
/?Displays this help message.

Examples: OPENFILES /Disconnect /? ; OPENFILES /Query /? ; OPENFILES /Local /?

P

PATH

Displays or sets a search path for executable files.

PATH [[drive:]path[;...][;%PATH%]

PATH ;

Type PATH ; to clear all search-path settings and direct cmd.exe to search only in the current directory.

Type PATH without parameters to display the current path.

Including %PATH% in the new path setting causes the old path to be appended to the new setting.

PAUSE

Suspends processing of a batch program and displays the message Press any key to continue . . .

PING

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] target_name

Options:

-t Ping the specified host until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C.
-aResolve addresses to hostnames.
-n countNumber of echo requests to send.
-l sizeSend buffer size.
-fSet Don't Fragment flag in packet.
-i TTLTime To Live.
-v TOSType Of Service.
-r countRecord route for count hops.
-s countTimestamp for count hops.
-j host-listLoose source route along host-list.
-k host-listStrict source route along host-list.
-w timeoutTimeout in milliseconds to wait for each reply.

POPD

Changes to the directory stored by the PUSHD command.

POPD

If Command Extensions are enabled the POPD command will delete any temporary drive letter created by PUSHD when you POPD that drive off the pushed directory stack.

PRINT

Prints a text file.

PRINT [/D:device] [[drive:][path]filename[...]]

/D:deviceSpecifies a print device.

PROMPT

Changes the cmd.exe command prompt.

PROMPT [text]

textSpecifies a new command prompt.

Prompt can be made up of normal characters and the following special codes:

$A& (Ampersand)
$B| (pipe)
$C( (Left parenthesis)
$DCurrent date
$EEscape code (ASCII code 27)
$F) (Right parenthesis)
$G> (greater-than sign)
$HBackspace (erases previous character)
$L< (less-than sign)
$NCurrent drive
$PCurrent drive and path
$Q= (equal sign)
$S  (space)
$TCurrent time
$VWindows version number
$_Carriage return and linefeed
$$$ (dollar sign)

If Command Extensions are enabled the PROMPT command supports the following additional formatting characters:

$+zero or more plus sign (+) characters depending upon the depth of the PUSHD directory stack, one character for each level pushed.
$MDisplays the remote name associated with the current drive letter or the empty string if current drive is not a network drive.

PUSHD

Stores the current directory for use by the POPD command, then changes to the specified directory.

PUSHD [path | ..]

pathSpecifies the directory to make the current directory.

If Command Extensions are enabled the PUSHD command accepts network paths in addition to the normal drive letter and path. If a network path is specified, PUSHD will create a temporary drive letter that points to that specified network resource and then change the current drive and directory, using the newly defined drive letter. Temporary drive letters are allocated from Z: on down, using the first unused drive letter found.

Q

QUERY

QUERY { PROCESS | SESSION | TERMSERVER | USER }

query process

Displays information about processes.

QUERY PROCESS [* | processid | username | sessionname | /ID:nn | programname] [/SERVER:servername]

*Display all visible processes.
processidDisplay process specified by processid.
usernameDisplay all processes belonging to username.
sessionnameDisplay all processes running at sessionname.
/ID:nnDisplay all processes running at session nn.
programnameDisplay all processes associated with programname.
/SERVER:servernameThe Terminal server to be queried.

query sessions

Display information about Terminal Sessions.

QUERY SESSION [sessionname | username | sessionid] [/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER]

sessionnameIdentifies the session named sessionname.
usernameIdentifies the session with user username.
sessionidIdentifies the session with ID sessionid.
/SERVER:servernameThe server to be queried (default is current).
/MODEDisplay current line settings.
/FLOWDisplay current flow control settings.
/CONNECTDisplay current connect settings.
/COUNTERDisplay current Terminal Services counters information.

query termserver

Displays the available application terminal servers on the network.

QUERY TERMSERVER [servername] [/DOMAIN:domain] [/ADDRESS] [/CONTINUE]

servernameIdentifies a Terminal server.
/DOMAIN:domainDisplays information for the specified domain (defaults to the current domain).
/ADDRESSDisplays network and node addresses.
/CONTINUEDoes not pause after each screen of information.

query user

Display information about users logged on to the system.

QUERY USER [username | sessionname | sessionid] [/SERVER:servername]

usernameIdentifies the username.
sessionnameIdentifies the session named sessionname.
sessionidIdentifies the session with ID sessionid.
/SERVER:servernameThe server to be queried (default is current).

R

RD, RMDIR

Availability: +Windows 2000 Professional | +Windows 2000 Server

Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path

RD [/S] [/Q] [drive:]path

/SRemoves all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree.
/QQuiet mode, do not ask if OK to remove a directory tree with /S

RECOVER

Recovers readable information from a bad or defective disk.

RECOVER [drive:][path]filename

Consult the online Command Reference in Windows Help before using the RECOVER command.

REG

REG operation [Parameter List]

Operation[ QUERY | ADD | DELETE | COPY | SAVE | LOAD | UNLOAD | RESTORE | COMPARE | EXPORT | IMPORT | FLAGS ]

Return Code: (Except for REG COMPARE)

0- Successful
1- Failed

For help on a specific operation type: REG Operation /?

Examples: REG QUERY /? ; REG ADD /? ; REG DELETE /? ; REG COPY /? ; REG SAVE /? ; REG RESTORE /? ; REG LOAD /? ; REG UNLOAD /? ; REG COMPARE /? ; REG EXPORT /? ; REG IMPORT /? ; REG FLAGS /?

REM

Availability: +Windows 2000 Professional | +Windows 2000 Server

Records comments (remarks) in a batch file or CONFIG.SYS.

REM [comment]

REN, RENAME

Availability: +Windows 2000 Professional | +Windows 2000 Server

Renames a file or files.

RENAME [drive:][path]filename1 filename2.

REN [drive:][path]filename1 filename2.

Note that you cannot specify a new drive or path for your destination file.

REPLACE

Availability: +Windows 2000 Professional | +Windows 2000 Server

Replaces files.

REPLACE [drive1:][path1]filename [drive2:][path2] [/A] [/P] [/R] [/W]

REPLACE [drive1:][path1]filename [drive2:][path2] [/P] [/R] [/S] [/W] [/U]

[drive1:][path1]filenameSpecifies the source file or files.
[drive2:][path2]Specifies the directory where files are to be replaced.
/AAdds new files to destination directory. Cannot use with /S or /U switches.
/PPrompts for confirmation before replacing a file or adding a source file.
/RReplaces read-only files as well as unprotected files.
/SReplaces files in all subdirectories of the destination directory. Cannot use with the /A switch.
/WWaits for you to insert a disk before beginning.
/UReplaces (updates) only files that are older than source files. Cannot use with the /A switch.

ROBOCOPY

Availability: +Windows 7 | +Windows Server 2008 | Res. Kit

ROBOCOPY -- Robust File Copy for Windows

Usage: ROBOCOPY source destination [file [file]...] [options]

sourceSource Directory (drive:\path or \\server\share\path).
destinationDestination Dir (drive:\path or \\server\share\path).
fileFile(s) to copy (names/wildcards: default is "*.*").

Copy options:

/Scopy Subdirectories, but not empty ones.
/Ecopy subdirectories, including Empty ones.
/LEV:nonly copy the top n LEVels of the source directory tree.
/Zcopy files in restartable mode.
/Bcopy files in Backup mode.
/ZBuse restartable mode; if access denied use Backup mode.
/EFSRAWcopy all encrypted files in EFS RAW mode.
/COPY:copyflag[s]what to COPY for files (default is /COPY:DAT). (copyflags : D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs, O=Owner info, U=aUditing info)
/DCOPY:TCOPY Directory Timestamps.
/SECcopy files with SECurity (equivalent to /COPY:DATS).
/COPYALLCOPY ALL file info (equivalent to /COPY:DATSOU).
/NOCOPYCOPY NO file info (useful with /PURGE).
/SECFIXFIX file SECurity on all files, even skipped files.
/TIMFIXFIX file TIMes on all files, even skipped files.
/PURGEdelete dest files/dirs that no longer exist in source.
/MIRMIRror a directory tree (equivalent to /E plus /PURGE).
/MOVMOVe files (delete from source after copying).
/MOVEMOVE files AND dirs (delete from source after copying).
/A+:[RASHCNET]add the given Attributes to copied files.
/A-:[RASHCNET]remove the given Attributes from copied files.
/CREATECREATE directory tree and zero-length files only.
/FATcreate destination files using 8.3 FAT file names only.
/256turn off very long path (> 256 characters) support.
/MON:nMONitor source; run again when more than n changes seen.
/MOT:mMOnitor source; run again in m minutes Time, if changed.
/RH:hhmm-hhmmRun Hours - times when new copies may be started.
/PFcheck run hours on a Per File (not per pass) basis.
/IPG:nInter-Packet Gap (ms), to free bandwidth on slow lines.
/SLcopy symbolic links versus the target.

File Selection Options:

/Acopy only files with the Archive attribute set.
/Mcopy only files with the Archive attribute and reset it.
/IA:[RASHCNETO]Include only files with any of the given Attributes set.
/XA:[RASHCNETO]eXclude files with any of the given Attributes set.
/XF file [file]...eXclude Files matching given names/paths/wildcards.
/XD dirs [dirs]...eXclude Directories matching given names/paths.
/XCeXclude Changed files.
/XNeXclude Newer files.
/XOeXclude Older files.
/XXeXclude eXtra files and directories.
/XLeXclude Lonely files and directories.
/ISInclude Same files.
/ITInclude Tweaked files.
/MAX:nMAXimum file size - exclude files bigger than n bytes.
/MIN:nMINimum file size - exclude files smaller than n bytes.
/MAXAGE:nMAXimum file AGE - exclude files older than n days/date.
/MINAGE:nMINimum file AGE - exclude files newer than n days/date.
/MAXLAD:nMAXimum Last Access Date - exclude files unused since n.
/MINLAD:nMINimum Last Access Date - exclude files used since n. (If n < 1900 then n = n days, else n = YYYYMMDD date).
/XJeXclude Junction points. (normally included by default).
/FFTassume FAT File Times (2-second granularity).
/DSTcompensate for one-hour DST time differences.
/XJDeXclude Junction points for Directories.
/XJFeXclude Junction points for Files.

Retry Options:

/R:nnumber of Retries on failed copies: default 1 million.
/W:nWait time between retries: default is 30 seconds.
/REGSave /R:n and /W:n in the Registry as default settings.
/TBDwait for sharenames To Be Defined (retry error 67).

Logging Options:

/LList only - don't copy, timestamp or delete any files.
/Xreport all eXtra files, not just those selected.
/Vproduce Verbose output, showing skipped files.
/TSinclude source file Time Stamps in the output.
/FPinclude Full Pathname of files in the output.
/BYTESPrint sizes as bytes.
/NSNo Size - don't log file sizes.
/NCNo Class - don't log file classes.
/NFLNo File List - don't log file names.
/NDLNo Directory List - don't log directory names.
/NPNo Progress - don't display % copied.
/ETAshow Estimated Time of Arrival of copied files.
/LOG:fileoutput status to LOG file (overwrite existing log).
/LOG+:fileoutput status to LOG file (append to existing log).
/UNILOG:fileoutput status to LOG file as UNICODE (overwrite existing log).
/UNILOG+:fileoutput status to LOG file as UNICODE (append to existing log).
/TEEoutput to console window, as well as the log file.
/NJHNo Job Header.
/NJSNo Job Summary.
/UNICODEoutput status as UNICODE.

Job Options:

/JOB:jobnametake parameters from the named JOB file.
/SAVE:jobnameSAVE parameters to the named job file.
/QUITQUIT after processing command line (to view parameters).
/NOSDNO Source Directory is specified.
/NODDNO Destination Directory is specified.
/IFInclude the following Files.

ROUTE

Availability: +Windows 2000 Professional | +Windows 2000 Server

Manipulates network routing tables.

ROUTE [-f] [-p] [-4|-6] command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]

-fClears the routing tables of all gateway entries. If this is used in conjunction with one of the commands, the tables are cleared prior to running the command.
-pWhen used with the ADD command, makes a route persistent across boots of the system. By default, routes are not preserved when the system is restarted. Ignored for all other commands, which always affect the appropriate persistent routes. This option is not supported in Windows 95.
-4Force using IPv4.
-6Force using IPv6.
commandOne of these: PRINT Prints a route; ADD Adds a route; DELETE Deletes a route; CHANGE Modifies an existing route.
destinationSpecifies the host.
MASKSpecifies that the next parameter is the 'netmask' value.
netmaskSpecifies a subnet mask value for this route entry. If not specified, it defaults to 255.255.255.255.
gatewaySpecifies gateway.
interfacethe interface number for the specified route.
METRICspecifies the metric, i.e. cost for the destination.

All symbolic names used for destination are looked up in the network database file NETWORKS. The symbolic names for gateway are looked up in the host name database file HOSTS.

If the command is PRINT or DELETE, destination or gateway can be a wildcard, (wildcard is specified as a star '*'), or the gateway argument may be omitted.

If Dest contains a * or ?, it is treated as a shell pattern, and only matching destination routes are printed. The '*' matches any string, and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.

Pattern match is only allowed in PRINT command.

Diagnostic Notes: Invalid MASK generates an error, that is when (DEST & MASK) != DEST.

Example route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1

The route addition failed: The specified mask parameter is invalid. (Destination & Mask) != Destination.

Examples:

route PRINT ; route PRINT -4 ; route PRINT -6 ; route PRINT 157* Only prints those matching 157*

routeADD 157.0.0.0MASK 255.0.0.0157.55.80.1METRIC 3IF 2
^ destination^ mask^ gateway^ metric^ Interface

If IF is not given, it tries to find the best interface for a given gateway.

route ADD 3ffe::/32 3ffe::1 ; route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2

CHANGE is used to modify gateway and/or metric only.

route DELETE 157.0.0.0 ; route DELETE 3ffe::/32

RUNAS

Availability: +Windows 2000 Professional | +Windows 2000 Server

RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ] /user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ] /smartcard [/user:<UserName>] program

RUNAS /trustlevel:<TrustLevel> program

/noprofileSpecifies that the user's profile should not be loaded. This causes the application to load more quickly, but can cause some applications to malfunction.
/profileSpecifies that the user's profile should be loaded. This is the default.
/envTo use current environment instead ot user's.
/netonlyUse if the credentials specified are for remote access only.
/savecredTo use credentials previously saved by the user. This option is not available on Windows Vista Home or Windows Vista Starter Editions and will be ignored.
/smartcardUse if the credentials are to be supplied from a smartcard.
/user:<UserName>Should be in form USER@DOMAIN or DOMAIN\USER.
/showtrustlevelsDisplays the trust levels that can be used as arguments to /trustlevel.
/trustlevel:<Level>Should be one of Levels enumerated in /showtrustlevels.
programCommand line for EXE. See below for examples.

Examples:

> runas /noprofile /user:mymachine\administrator cmd

> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"

> runas /env /user:user@domain.microsoft.com "notepad \"my File.txt\""

NOTE: Enter user's password oniy when prompted.

NOTE: /profile is not compatible with /netonly.

NOTE: /savecred is not compatible with /smartcard.

S

SC

DESCRIPTION: SC is a command line program used for communicating with the Service Control Manager and services.

USAGE: sc <server> [command] [service name] <option1> <option2>...

The option <server> has the form "\\ServerName"

Further help on commands can be obtained by typing: "sc [command]"

Commands:

queryQueries the status for a service, or enumerates the status for types of services.
queryexQueries the extended status for a service, or enumerates the status for types of services.
startStarts a service.
pauseSends a PAUSE control request to a service.
interrogateSends an INTERROGATE control request to a service.
continueSends a CONTINUE control request to a service.
stopSends a STOP request to a service.
configChanges the configuration of a service (persistent).
descriptionChanges the description of a service.
failureChanges the actions taken by a service upon failure.
failureflagChanges the failure actions flag of a service.
sidtypeChanges the service SID type of a service.
privsChanges the required privileges of a service.
qcQueries the configuration information for a service.
qdescriptionQueries the description for a service.
qfailureQueries the actions taken by a service upon failure.
qfailureflagQueries the failure actions flag of a service.
qsidtypeQueries the service SID type of a service.
qprivsQueries the required privileges of a service.
deleteDeletes a service (from the registry).
createCreates a service. (adds it to the registry).
controlSends a control to a service.
sdshowDisplays a service's security descriptor.
sdsetSets a service's security descriptor.
showsidDisplays the service SID string corresponding to an arbitrary name.
GetDisplayNameGets the DisplayName for a service.
GetKeyNameGets the ServiceKeyName for a service.
EnumDependEnumerates Service Dependencies.

The following commands don't require a service name: sc <server> <command> <option>

boot (ok | bad)Indicates whether the last boot should be saved as the last-known-good boot configuration
LockLocks the Service Database
QueryLockQueries the LockStatus for the SCManager Database

EXAMPLE: sc start MyService

Would you like to see help for the QUERY and QUERYEX commands? [ y | n ]:
y

QUERY and QUERYEX options:

If the query command is followed by a service name, the status for that service is returned. Further options do not apply in this case. If the query command is followed by nothing or one of the options listed below, the services are enumerated.

type=Type of services to enumerate (driver, service, all) (default = service)
/state=State of services to enumerate (inactive, all) (default = active)
/bufsize=The size (in bytes) of the enumeration buffer (default = 4096)
/ri=The resume index number at which to begin the enumeration (default = 0)
group=Service group to enumerate (default = all groups)

Syntax examples:

sc queryEnumerates status for active services & drivers
sc query eventlogDisplays status for the eventlog service
sc queryex eventlogDisplays extended status for the eventlog service
sc query type= driverEnumerates only active drivers
sc query type= serviceEnumerates only Win32 services
sc query state= allEnumerates all services & drivers
sc query bufsize= 50Enumerates with a 50 byte buffer
sc query ri= 14Enumerates with resume index = 14
sc queryex group= ""Enumerates active services not in a group
sc query type= interactEnumerates all interactive services
sc query type= driver group= NDISEnumerates all NDIS drivers

SCHTASKS

SCHTASKS /parameter [arguments]

Description: Enables an administrator to create, delete, query, change, run and end scheduled tasks on a local or remote system.

Parameter List:

/CreateCreates a new scheduled task.
/DeleteDeletes the scheduled task(s).
/QueryDisplays all scheduled tasks.
/ChangeChanges the properties of scheduled task.
/RunRuns the scheduled task immediately.
/EndStops the currently running scheduled task.
/?Displays this help message.

Examples: SCHTASKS ; SCHTASKS /? ; SCHTASKS /Run /? ; SCHTASKS /End /? ; SCHTASKS /Create /? ; SCHTASKS /Delete /? ; SCHTASKS /Query /? ; SCHTASKS /Change /?

SET

Displays, sets, or removes cmd.exe environment variables.

SET [variable=[string]]

variableSpecifies the environment-variable name.
stringSpecifies a series of characters to assign to the variable.

Type SET without parameters to display the current environment variables.

If Command Extensions are enabled SET changes as follows:

SET command invoked with just a variable name, no equal sign or value will display the value of all variables whose prefix matches the name given to the SET command. For example: SET P would display all variables that begin with the letter 'P'.

SET command will set the ERRORLEVEL to 1 if the variable name is not found in the current environment.

SET command will not allow an equal sign to be part of the name of a variable.

Two new switches have been added to the SET command:

SET /A expression

SET /P variable=[promptString]

The /A switch specifies that the string to the right of the equal sign is a numerical expression that is evaluated. The expression evaluator is pretty simple and supports the following operations, in decreasing order of precedence:

()- grouping
! ~ -- unary operators
* / %- arithmetic operators
+ -- arithmetic operators
<< >>- logical shift
&- bitwise and
^- bitwise exclusive or
|- bitwise or
= *= /= %= += -= &= ^= |= <<= >>=- assignment
,- expression separator

If you use any of the logical or modulus operators, you will need to enclose the expression string in quotes. Any non-numeric strings in the expression are treated as environment variable names whose values are converted to numbers before using them. If an environment variable name is specified but is not defined in the current environment, then a value of zero is used. This allows you to do arithmetic with environment variable values without having to type all those % signs to get their values. If SET /A is executed from the command line outside of a command script, then it displays the final value of the expression. The assignment operator requires an environment variable name to the left of the assignment operator. Numeric values are decimal numbers, unless prefixed by 0x for hexadecimal numbers, and 0 for octal numbers. So 0x12 is the same as 18 is the same as 022. Please note that the octal notation can be confusing: 08 and 09 are not valid numbers because 8 and 9 are not valid octal digits.

The /P switch allows you to set the value of a variable to a line of input entered by the user. Displays the specified promptString before reading the line of input. The promptString can be empty.

Environment variable substitution has been enhanced as follows:

%PATH:str1=str2% would expand the PATH environment variable, substituting each occurrence of "str1" in the expanded result with "str2". "str2" can be the empty string to effectively delete all occurrences of "str1" from the expanded output. "str1" can begin with an asterisk, in which case it will match everything from the beginning of the expanded output to the first occurrence of the remaining portion of str1.

May also specify substrings for an expansion.

%PATH:~10,5% would expand the PATH environment variable, and then use only the 5 characters that begin at the 11th (offset 10) character of the expanded result. If the length is not specified, then it defaults to the remainder of the variable value. If either number (offset or length) is negative, then the number used is the length of the environment variable value added to the offset or length specified.

%PATH:~-10% would extract the last 10 characters of the PATH variable.

%PATH:~0,-2% would extract all but the last 2 characters of the PATH variable.

Finally, support for delayed environment variable expansion has been added. This support is always disabled by default, but may be enabled/disabled via the /V command line switch to CMD.EXE. See CMD /?

Delayed environment variable expansion is useful for getting around the limitations of the current expansion which happens when a line of text is read, not when it is executed. The following example demonstrates the problem with immediate variable expansion:

set VAR=before
if "%VAR%" == "before" (
  set VAR=after
  if "%VAR%" == "after" @echo If you see this, it worked
)

would never display the message, since the %VAR% in BOTH IF statements is substituted when the first IF statement is read, since it logically includes the body of the IF, which is a compound statement. So the IF inside the compound statement is really comparing "before" with "after" which will never be equal. Similarly, the following example will not work as expected:

set LIST=
for %i in (*) do set LIST=%LIST% %i
echo %LIST%

in that it will NOT build up a list of files in the current directory, but instead will just set the LIST variable to the last file found. Again, this is because the %LIST% is expanded just once when the FOR statement is read, and at that time the LIST variable is empty. So the actual FOR loop we are executing is:

for %i in (*) do set LIST= %i which just keeps setting LIST to the last file found.

Delayed environment variable expansion allows you to use a different character (the exclamation mark) to expand environment variables at execution time. If delayed variable expansion is enabled, the above examples could be written as follows to work as intended:

set VAR=before
if "%VAR%" == "before" (
  set VAR=after
  if "!VAR!" == "after" @echo If you see this, it worked
)

set LIST=
for %i in (*) do set LIST=!LIST! %i
echo %LIST%

If Command Extensions are enabled, then there are several dynamic environment variables that can be expanded but which don't show up in the list of variables displayed by SET. These variable values are computed dynamically each time the value of the variable is expanded. If the user explicitly defines a variable with one of these names, then that definition will override the dynamic one described below:

%CD%Expands to the current directory string.
%DATE%Expands to current date using same format as DATE command.
%TIME%Expands to current time using same format as TIME command.
%RANDOM%Expands to a random decimal number between 0 and 32767.
%ERRORLEVEL%Expands to the current ERRORLEVEL value
%CMDEXTVERSION%Expands to the current Command Processor Extensions version number.
%CMDCMDLINE%Expands to the original command line that invoked the Command Processor.

SETLOCAL

Begins localization of environment changes in a batch file. Environment changes made after SETLOCAL has been issued are local to the batch file. ENDLOCAL must be issued to restore the previous settings. When the end of a batch script is reached, an implied ENDLOCAL is executed for any outstanding SETLOCAL commands issued by that batch script.

SETLOCAL

If Command Extensions are enabled SETLOCAL changes as follows:

SETLOCAL batch command now accepts optional arguments:

ENABLEEXTENSIONS / DISABLEEXTENSIONSEnable or disable command processor extensions. See CMD /? for details.
ENABLEDELAYEDEXPANSION / DISABLEDELAYEDEXPANSIONEnable or disable delayed environment variable expansion. See SET /? for details.

These modifications last until the matching ENDLOCAL command, regardless of their setting prior to the SETLOCAL command.

The SETLOCAL command will set the ERRORLEVEL value if given an argument. It will be zero if one of the two valid arguments is given and one otherwise. You can use this in batch scripts to determine if the extensions are available, using the following technique:

VERIFY OTHER 2>nul
SETLOCAL ENABLEEXTENSIONS
IF ERRORLEVEL 1 echo Unable to enable extensions

This works because on old versions of CMD.EXE, SETLOCAL does NOT set the ERRORLEVEL value. The VERIFY command with a bad argument initializes the ERRORLEVEL value to a non-zero value.

SETX

SetX has three ways of working:

Syntax 1: SETX [/S system [/U [domain\]user [/P [password]]]] var value [/M]

Syntax 2: SETX [/S system [/U [domain\]user [/P [password]]]] var /K regpath [/M]

Syntax 3: SETX [/S system [/U [domain\]user [/P [password]]]] /F file {var {/A x,y | /R x,y string}[/M] | /X} [/D delimiters]

Description: Creates or modifies environment variables in the user or system environment. Can set variables based on arguments, regkeys or file input.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specifies the password for the given user context. Prompts for input if omitted.
varSpecifies the environment variable to set.
valueSpecifies a value to be assigned to the environment variable.
/K regpathSpecifies that the variable is set based on information from a registry key. Path should be specified in the format of hive\key\...\value. For example, HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\StandardName.
/F fileSpecifies the filename of the text file to use.
/A x,ySpecifies absolute file coordinates (line X, item Y) as parameters to search within the file.
/R x,y stringSpecifies relative file coordinates with respect to "string" as the search parameters.
/MSpecifies that the variable should be set in the system wide (HKEY_LOCAL_MACHINE) environment. The default is to set the variable under the HKEY_CURRENT_USER environment.
/XDisplays file contents with x,y coordinates.
/D delimitersSpecifies additional delimiters such as "," or "\". The built-in delimiters are space, tab, carriage return, and linefeed. Any ASCII character can be used as an additional delimiter. The maximum number of delimiters, including the built-in delimiters, is 15.
/?Displays this help message.

NOTE:

1) SETX writes variables to the master environment in the registry.

2) On a local system, variables created or modified by this tool will be available in future command windows but not in the current CMD.exe command window.

3) On a remote system, variables created or modified by this tool will be available at the next logon session.

4) The valid Registry Key data types are REG_DWORD, REG_EXPAND_SZ, REG_SZ, REG_MULTI_SZ.

5) Supported hives: HKEY_LOCAL_MACHINE (HKLM), HKEY_CURRENT_USER (HKCU).

6) Delimiters are case sensitive.

7) REG_DWORD values are extracted from the registry in decimal format.

Examples:

SETX MACHINE COMPAQ

SETX MACHINE "COMPAQ COMPUTER" /M

SETX MYPATH "%PATH%"

SETX MYPATH ~PATH~

SETX /S system /U user /P password MACHINE COMPAQ

SETX /S system /U user /P password MYPATH ^%PATH^%

SETX TZONE /K HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\StandardName

SETX BUILD /K "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber" /M

SETX /S system /U user /P password TZONE /K HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\StandardName

SETX /S system /U user /P password BUILD /K "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber" /M

SETX /F ipconfig.out /X

SETX IPADDR /F ipconfig.out /A 5,11

SETX OCTET1 /F ipconfig.out /A 5,3 /D "#$*."

SETX IPGATEWAY /F ipconfig.out /R 0,7 Gateway

SETX /S system /U user /P password /F c:\ipconfig.out /X

SFC

Microsoft (R) Windows (R) Resource Checker Version 6.0

Copyright (c) 2006 Microsoft Corporation. All rights reserved.

Scans the integrity of all protected system files and replaces incorrect versions with correct Microsoft versions.

SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=<file>] [/VERIFYFILE=<file>] [/OFFWINDIR=<offline windows directory> /OFFBOOTDIR=<offline boot directory>]

/SCANNOWScans integrity of all protected system files and repairs files with problems when possible.
/VERIFYONLYScans integrity of all protected system files. No repair operation is performed.
/SCANFILEScans integrity of the referenced file, repairs file if problems are identified. Specify full path <file>.
/VERIFYFILEVerifies the integrity of the file with full path <file>. No repair operation is performed.
/OFFBOOTDIRFor offline repair specify the location of the offline boot directory.
/OFFWINDIRFor offline repair specify the location of the offline windows directory.

e.g.

sfc /SCANNOW ; sfc /VERIFYONLY ; sfc /VERIFYFILE=c:\windows\system32\kernel32.dll

sfc /SCANFILE=d:\windows\system32\kernel32.dll /OFFBOOTDIR=d:\ /OFFWINDIR=d:\windows

SHIFT

Changes the position of replaceable parameters in a batch file.

SHIFT [/n]

If Command Extensions are enabled the SHIFT command supports the /n switch which tells the command to start shifting at the nth argument, where n may be between zero and eight. For example: SHIFT /2 would shift %3 to %2, %4 to %3, etc. and leave %0 and %1 unaffected.

SHUTDOWN

Usage: SHUTDOWN [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

No argsDisplay help. This is the same as typing /?.
/?Display help. This is the same as not typing any options.
/iDisplay the graphical user interface (GUI). This must be the first option.
/lLog off. This cannot be used with /m or /d options.
/sShutdown the computer.
/rShutdown and restart the computer.
/gShutdown and restart the computer. After the system is rebooted, restart any registered applications.
/aAbort a system shutdown. This can only be used during the time-out period.
/pTurn off the local computer with no time-out or warning. Can be used with /d and /f options.
/hHibernate the local computer. Can be used with the /f option. (V+)
/eDocument the reason for an unexpected shutdown of a computer.
/m \\computerSpecify the target computer.
/t xxxSet the time-out period before shutdown to xxx seconds. The valid range is 0-600, with a default of 30. Using /t xxx implies the /f option.
/c "comment"Comment on the reason for the restart or shutdown. Maximum of 512 characters allowed.
/fForce running applications to close without forewarning users. /f is automatically set when used in conjunction with /t xxx.
/d [p|u:]xx:yyProvide the reason for the restart or shutdown.
p indicates that the restart or shutdown is planned.
u indicates that the reason is user defined.
If neither p nor u is specified the restart or shutdown is unplanned.
xx is the major reason number (positive integer less than 256).
yy is the minor reason number (positive integer less than 65536).

Reasons on this computer: (E = Expected, U = Unexpected, P = planned, C = customer defined)

TypeMajorMinorTitle
 U00Other (Unplanned)
E00Other (Unplanned)
E P00Other (Planned)
 U_05Other Failure: System Unresponsive
E11Hardware: Maintenance (Unplanned)
E P11Hardware: Maintenance (Planned)
E12Hardware: Installation (Unplanned)
E P12Hardware: Installation (Planned)
  P23Operating System: Upgrade (Planned)
E24Operating System: Reconfiguration (Unplanned)
E P24Operating System: Reconfiguration (Planned)
 P216Operating System: Service pack (Planned)
217Operating System: Hot fix (Unplanned)
 P217Operating System: Hot fix (Planned)
218Operating System: Security fix (Unplanned)
 P218Operating System: Security fix (Planned)
E41Application: Maintenance (Unplanned)
E P41Application: Maintenance (Planned)
E P42Application: Installation (Planned)
E45Application: Unresponsive
E46Application: Unstable
 U515System Failure: Stop error
E519Security issue
 U519Security issue
E P519Security issue
E520Loss of network connectivity (Unplanned)
 U611Power Failure: Cord Unplugged
 U612Power Failure: Environment
  P70Legacy API shutdown

SORT

SORT [/R] [/+n] [/M kilobytes] [/L locale] [/REC recordbytes] [[drive1:][path1]filename1] [/T [drive2:][path2]] [/O [drive3:][path3]filename3]

/+nSpecifies the character number, n, to begin each comparison. /+3 indicates that each comparison should begin at the 3rd character in each line. Lines with fewer than n characters collate before other lines. By default comparisons start at the first character in each line.
/L[OCALE] localeOverrides the system default locale with the specified one. The ""C"" locale yields the fastest collating sequence and is currently the only alternative. The sort is always case insensitive.
/M[EMORY] kilobytesSpecifies amount of main memory to use for the sort, in kilobytes. The memory size is always constrained to be a minimum of 160 kilobytes. If the memory size is specified the exact amount will be used for the sort, regardless of how much main memory is available.

The best performance is usually achieved by not specifying a memory size. By default the sort will be done with one pass (no temporary file) if it fits in the default maximum memory size, otherwise the sort will be done in two passes (with the partially sorted data being stored in a temporary file) such that the amounts of memory used for both the sort and merge passes are equal. The default maximum memory size is 90% of available main memory if both the input and output are files, and 45% of main memory otherwise.
/REC[ORD_MAXIMUM] charactersSpecifies the maximum number of characters in a record (default 4096, maximum 65535).
/R[EVERSE]Reverses the sort order; that is, sorts Z to A, then 9 to 0.
[drive1:][path1]filename1Specifies the file to be sorted. If not specified, the standard input is sorted. Specifying the input file is faster than redirecting the same file as standard input.
/T[EMPORARY] [drive2:][path2]Specifies the path of the directory to hold the sort's working storage, in case the data does not fit in main memory. The default is to use the system temporary directory.
/O[UTPUT] [drive3:][path3]filename3Specifies the file where the sorted input is to be stored. If not specified, the data is written to the standard output. Specifying the output file is faster than redirecting standard output to the same file.

START

Starts a separate window to run a specified program or command.

START [“title”] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/AFFINITY <hex affinity>] [/WAIT] [/B] [command/program] [parameters]

“title”Title to display in window title bar.
pathStarting directory
BStart application without creating a new window. The application has ^C handling ignored. Unless the application enables ^C processing, ^Break is the only way to interrupt the application
IThe new environment will be the original environment passed to the cmd.exe and not the current environment.
MINStart window minimized
MAXStart window maximized
SEPARATEStart 16-bit Windows program in separate memory space
SHAREDStart 16-bit Windows program in shared memory space
LOWStart application in the IDLE priority class
NORMALStart application in the NORMAL priority class
HIGHStart application in the HIGH priority class
REALTIMEStart application in the REALTIME priority class
ABOVENORMALStart application in the ABOVENORMAL priority class
BELOWNORMALStart application in the BELOWNORMAL priority class
AFFINITYThe new application will have the specified processor affinity mask, expressed as a hexadecimal number.
WAITStart application and wait for it to terminate
command/programIf it is an internal cmd command or a batch file then the command processor is run with the /K switch to cmd.exe. This means that the window will remain after the command has been run.
If it is not an internal cmd command or batch file then it is a program and will run as either a windowed application or a console application.
parametersThese are the parameters passed to the command/program

NOTE: The SEPERATE and SHARED options are not supported on 64-bit platforms.

If Command Extensions are enabled, external command invocation through the command line or the START command changes as follows:

non-executable files may be invoked through their file association just by typing the name of the file as a command. (e.g. WORD.DOC would launch the application associated with the .DOC file extension). See the ASSOC and FTYPE commands for how to create these associations from within a command script.

When executing an application that is a 32-bit GUI application, CMD.EXE does not wait for the application to terminate before returning to the command prompt. This new behavior does NOT occur if executing within a command script.

When executing a command line whose first token is the string "CMD " without an extension or path qualifier, then "CMD" is replaced with the value of the COMSPEC variable. This prevents picking up CMD.EXE from the current directory.

When executing a command line whose first token does NOT contain an extension, then CMD.EXE uses the value of the PATHEXT environment variable to determine which extensions to look for and in what order. The default value for the PATHEXT variable is: .COM;.EXE;.BAT;.CMD

Notice the syntax is the same as the PATH variable, with semicolons separating the different elements.

When searching for an executable, if there is no match on any extension, then looks to see if the name matches a directory name. If it does, the START command launches the Explorer on that path. If done from the command line, it is the equivalent to doing a CD /D to that path.

SUBST

Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]

SUBST drive1: /D

drive1:Specifies a virtual drive to which you want to assign a path.
[drive2:]pathSpecifies a physical drive and path you want to assign to a virtual drive.
/DDeletes a substituted (virtual) drive.

Type SUBST with no parameters to display a list of current virtual drives.

SYSTEMINFO

SYSTEMINFO [/S system [/U username [/P [password]]]] [/FO format] [/NH]

Description: This tool displays operating system configuration information for a local or remote machine, including service pack levels.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specifies the password for the given user context. Prompts for input if omitted.
/FO formatSpecifies the format in which the output is to be displayed. Valid values: "TABLE", "LIST", "CSV".
/NHSpecifies that the "Column Header" should not be displayed in the output. Valid only for "TABLE" and "CSV" formats.
/?Displays this help message.

Examples: SYSTEMINFO ; SYSTEMINFO /? ; SYSTEMINFO /S system ; SYSTEMINFO /S system /U user ;

SYSTEMINFO /S system /U domain\user /P password /FO TABLE ; SYSTEMINFO /S system /FO LIST ; SYSTEMINFO /S system /FO CSV /NH

T

TAKEOWN (V+)

TAKEOWN [/S system [/U username [/P [password]]]] /F filename [/A] [/R [/D prompt]]

Description: This tool allows an administrator to recover access to a file that was denied by re-assigning file ownership.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specifies the password for the given user context. Prompts for input if omitted.
/F filenameSpecifies the filename or directory name pattern. Wildcard "*" can be used to specify the pattern. Allows sharename\filename.
/AGives ownership to the administrators group instead of the current user.
/RRecurse: instructs tool to operate on files in specified directory and all subdirectories.
/D promptDefault answer used when the current user does not have the "list folder" permission on a directory. This occurs while operating recursively (/R) on sub-directories. Valid values "Y" to take ownership or "N" to skip.
/?Displays this help message.

NOTE:

1) If /A is not specified, file ownership will be given to the current logged on user.

2) Mixed patterns using "?" and "*" are not supported.

3) /D is used to suppress the confirmation prompt.

Examples:

TAKEOWN /?

TAKEOWN /F lostfile

TAKEOWN /F \\system\share\lostfile /A

TAKEOWN /F directory /R /D N

TAKEOWN /F directory /R /A

TAKEOWN /F *

TAKEOWN /F C:\Windows\System32\acme.exe

TAKEOWN /F %windir%\*.txt

TAKEOWN /S system /F MyShare\Acme*.doc

TAKEOWN /S system /U user /F MyShare\foo.dll

TAKEOWN /S system /U domain\user /P password /F share\filename

TAKEOWN /S system /U user /P password /F Doc\Report.doc /A

TAKEOWN /S system /U user /P password /F Myshare\*

TAKEOWN /S system /U user /P password /F Home\Logon /R

TAKEOWN /S system /U user /P password /F Myshare\directory /R /A

TASKKILL

TASKKILL [/S system [/U username [/P [password]]]] { [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]

Description: This tool is used to terminate tasks by process id (PID) or image name.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specifies the password for the given user context. Prompts for input if omitted.
/FI filterApplies a filter to select a set of tasks. Allows "*" to be used. ex. imagename eq acme*
/PID processidSpecifies the PID of the process to be terminated. Use TaskList to get the PID.
/IM imagenameSpecifies the image name of the process to be terminated. Wildcard '*' can be used to specify all tasks or image names.
/TTerminates the specified process and any child processes which were started by it.
/FSpecifies to forcefully terminate the process(es).
/?Displays this help message.

Filters:

Filter NameValid OperatorsValid Value(s)
STATUSeq, neRUNNING | NOT RESPONDING | UNKNOWN
IMAGENAMEeq, neImage name
PIDeq, ne, gt, lt, ge, lePID value
SESSIONeq, ne, gt, lt, ge, leSession number
CPUTIMEeq, ne, gt, lt, ge, leCPU time in the format of hh:mm:ss. hh - hours, mm - minutes, ss - seconds
MEMUSAGEeq, ne, gt, lt, ge, leMemory usage in KB
USERNAMEeq, neUser name in [domain\]user format
MODULESeq, neDLL name
SERVICESeq, neService name
WINDOWTITLEeq, neWindow title

NOTE

1) Wildcard '*' for /IM switch is accepted only when a filter is applied.

2) Termination of remote processes will always be done forcefully (/F).

3) "WINDOWTITLE" and "STATUS" filters are not considered when a remote machine is specified.

Examples: TASKKILL /IM notepad.exe ; TASKKILL /PID 1230 /PID 1241 /PID 1253 /T ; TASKKILL /F /IM cmd.exe /T ;

TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*" ; TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe ;

TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM * ; TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"

TASKLIST

TASKLIST [/S system [/U username [/P [password]]]] [/M [module] | /SVC | /V] [/FI filter] [/FO format] [/NH]

Description: This tool displays a list of currently running processes on either a local or remote machine.

Parameter List:

/S systemSpecifies the remote system to connect to.
/U [domain\]userSpecifies the user context under which the command should execute.
/P [password]Specifies the password for the given user context. Prompts for input if omitted.
/M [module]Lists all tasks currently using the given exe/dll name. If the module name is not specified all loaded modules are displayed.
/SVCDisplays services hosted in each process.
/VDisplays verbose task information.
/FI filterDisplays a set of tasks that match a given criteria specified by the filter.
/FO formatSpecifies the output format. Valid values: "TABLE", "LIST", "CSV".
/NHSpecifies that the "Column Header" should not be displayed in the output. Valid only for "TABLE" and "CSV" formats.
/?Displays this help message.

Filters:

Filter NameValid OperatorsValid Value(s)
STATUSeq, neRUNNING | NOT RESPONDING | UNKNOWN
IMAGENAMEeq, neImage name
PIDeq, ne, gt, lt, ge, lePID value
SESSIONeq, ne, gt, lt, ge, leSession number
SESSIONNAMEeq, neSession name
CPUTIMEeq, ne, gt, lt, ge, leCPU time in the format of hh:mm:ss. hh - hours, mm - minutes, ss - seconds
MEMUSAGEeq, ne, gt, lt, ge, leMemory usage in KB
USERNAMEeq, neUser name in [domain\]user format
SERVICESeq, neService name
WINDOWTITLEeq, neWindow title
MODULESeq, neDLL name

NOTE: "WINDOWTITLE" and "STATUS" filters are not supported when querying a remote machine.

Examples: TASKLIST ; TASKLIST /M ; TASKLIST /V /FO CSV ; TASKLIST /SVC /FO LIST

TASKLIST /M wbem* ; TASKLIST /S system /FO LIST ; TASKLIST /S system /U domain\username /FO CSV /NH ;

TASKLIST /S system /U username /P password /FO TABLE /NH ; TASKLIST /FI "USERNAME ne NT AUTHORITY\SYSTEM" /FI "STATUS eq running"

TIME

Displays or sets the system time.

TIME [/T | time]

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.

TIMEOUT (V+)

TIMEOUT [/T] timeout [/NOBREAK]

Description: This utility accepts a timeout parameter to wait for the specified time period (in seconds) or until any key is pressed. It also accepts a parameter to ignore the key press.

Parameter List:

/T timeoutSpecifies the number of seconds to wait. Valid range is -1 to 99999 seconds.
/NOBREAKIgnore key presses and wait specified time.
/?Displays this help message.

NOTE: A timeout value of -1 means to wait indefinitely for a key press.

Examples: TIMEOUT /? ; TIMEOUT /T 10 ; TIMEOUT /T 300 /NOBREAK ; TIMEOUT /T -1

TITLE

Sets the window title for the command prompt window.

TITLE [string]

stringSpecifies the title for the command prompt window.

TRACERT

Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Options:

-dDo not resolve addresses to hostnames.
-h maximum_hopsMaximum number of hops to search for target.
-j host-listLoose source route along host-list.
-w timeoutWait timeout milliseconds for each reply.

TREE

Graphically displays the folder structure of a drive or path.

TREE [drive:][path] [/F] [/A]

/FDisplay the names of the files in each folder.
/AUse ASCII instead of extended characters.

TYPE

Displays the contents of a text file or files.

TYPE [drive:][path]filename

V

VER

Availability: +Windows 2000 Professional | +Windows 2000 Server

Displays the Windows version.

VER

VERIFY

Availability: +Windows 2000 Professional | +Windows 2000 Server

Tells cmd.exe whether to verify that your files are written correctly to a disk.

VERIFY [ON | OFF]

Type VERIFY without a parameter to display the current VERIFY setting.

VOL

Availability: +Windows 2000 Professional | +Windows 2000 Server

Displays the disk volume label and serial number, if they exist.

VOL [drive:]

VSSADMIN

Availability: +Windows Vista | +Windows Server 2003

Administrator privileges will be needed for most commands (but not the help).

vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (V)

(C) Copyright 2001-2005 Microsoft Corp. (V)

---- Commands Supported ----

List Providers- List registered volume shadow copy providers
List Shadows- List existing volume shadow copies
List ShadowStorage- List volume shadow copy storage associations
List Volumes- List volumes eligible for shadow copies
List Writers- List subscribed volume shadow copy writers
Resize ShadowStorage- Resize a volume shadow copy storage association

vssadmin List Providers /?

- List registered volume shadow copy providers.

Example Usage: vssadmin List Providers

vssadmin list shadows /?

List Shadows [/For=ForVolumeSpec] [/Shadow=ShadowId|/Set=ShadowSetId]

- Displays existing shadow copies on the system. Without any options, all shadow copies on the system are displayed ordered by shadow copy set. Combinations of options can be used to refine the list operation.

- The Shadow Copy ID can be obtained by using the List Shadows command. When entering a Shadow ID, it must be in the following format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} where the X's are hexadecimal characters.

Example Usage: vssadmin List Shadows /Shadow={c5946237-af12-3f23-af80-51aadb3b20d5}

vssadmin list shadowstorage /?

List ShadowStorage [/For=ForVolumeSpec|/On=OnVolumeSpec]

- Displays all shadow copy storage associations on the system. To list all associations for a given volume, specify a ForVolumeSpec and no /On option. To list all associations on a given volume, specify an OnVolumeSpec and no /For option.

Example Usage: vssadmin List ShadowStorage /On=C:

vssadmin list volumes /?

- Displays all volumes which may be shadow copied.

Example Usage: vssadmin List Volumes

vssadmin list writers /?

- List subscribed volume shadow copy writers

Example Usage: vssadmin list writers

vssadmin resize shadowstorage /?

Resize ShadowStorage /For=ForVolumeSpec /On=OnVolumeSpec [/MaxSize=MaxSizeSpec]

- Resizes the maximum size for a shadow copy storage association between ForVolumeSpec and OnVolumeSpec. Resizing the storage association may cause shadow copies to disappear. If MaxSizeSpec is not specified, there no limit to the amount of space it may use. As certain shadow copies are deleted, the shadow copy storage space will then shrink. MaxSizeSpec must be 300MB or greater and accepts the following suffixes: KB, MB, GB, TB, PB and EB. Also, B, K, M, G, T, P, and E are acceptable suffixes. If a suffix is not supplied, MaxSizeSpec is in bytes.

Example Usage: vssadmin Resize ShadowStorage /For=C: /On=D: /MaxSize=900MB

W

W32TM

w32tm [/? | /register | /unregister ]

?this help screen.
registerregister to run as a service and add default configuration to the registry.
unregisterunregister service and remove all configuration information from the registry.

w32tm /monitor [/domain:<domain name>] [/computers:<name>[,<name>[,<name>...]]] [/threads:<num>] [/ipprotocol:<4|6>] [/nowarn]

domainspecifies which domain to monitor. If no domain name is given, or neither the domain nor computers option is specified, the default domain is used. This option may be used more than once.
computersmonitors the given list of computers. Computer names are separated by commas, with no spaces. If a name is prefixed with a '*', it is treated as an AD PDC. This option may be used more than once.
threadshow many computers to analyze simultaneously. The default value is 3. Allowed range is 1-50.
ipprotocolspecify the IP protocol to use. The default is to use whatever is available.
nowarnskip warning message.

w32tm /ntte <NT time epoch>

Convert a NT system time, in (10^-7)s intervals from 0h 1-Jan 1601, into a readable format.

w32tm /ntpte <NTP time epoch>

Convert an NTP time, in (2^-32)s intervals from 0h 1-Jan 1900, into a readable format.

w32tm /resync [/computer:<computer>] [/nowait] [/rediscover] [/soft]

Tell a computer that it should resynchronize its clock as soon as possible, throwing out all accumulated error statistics.

computer:<computer>computer that should resync. If not specified, the local computer will resync.
nowaitdo not wait for the resync to occur; return immediately. Otherwise, wait for the resync to complete before returning.
rediscoverredetect the network configuration and rediscover network sources, then resynchronize.
softresync utilizing existing error statistics. Not useful, provided for compatibility.

w32tm /stripchart /computer:<target> [/period:<refresh>] [/dataonly] [/samples:<count>] [/packetinfo] [/ipprotocol:<4|6>]

Display a strip chart of the offset between this computer and another computer.

computer:<target>the computer to measure the offset against.
period:<refresh>the time between samples, in seconds. The default is 2s.
dataonlydisplay only the data, no graphics.
samples:<count>collect <count> samples, then stop. If not specified, samples will be collected until Ctrl-C is pressed.
packetinfoprint out NTP packet response message.
ipprotocolspecify the IP protocol to use. The default is to use whatever is available.

w32tm /config [/computer:<target>] [/update] [/manualpeerlist:<peers>] [/syncfromflags:<source>] [/LocalClockDispersion:<seconds>] [/reliable:(YES|NO)] [/largephaseoffset:<milliseconds>]

computer:<target>adjusts the configuration of <target>. If not specified, the default is the local computer.
updatenotifies the time service that the configuration has changed, causing the changes to take effect.
manualpeerlist:<peers>sets the manual peer list to <peers>, which is a space-delimited list of DNS and/or IP addresses. When specifying multiple peers, this switch must be enclosed in quotes.
syncfromflags:<source>sets what sources the NTP client should sync from. <source> should be a comma separated list of these keywords (not case sensitive):
MANUAL - sync from peers in the manual peer list
DOMHIER - sync from an AD DC in the domain hierarchy
NO - sync from none
ALL - sync from both manual and domain peers
LocalClockDispersion:<seconds>configures the accuracy of the internal clock that w32time will assume when it can't acquire time from its configured sources.
reliable:(YES|NO)set whether this machine is a reliable time source. This setting is only meaningful on domain controllers.
YES - this machine is a reliable time service
NO - this machine is not a reliable time service
largephaseoffset:<milliseconds>sets the time difference between local and network time which w32time will consider a spike.

w32tm /tz

Display the current time zone settings.

w32tm /dumpreg [/subkey:<key>] [/computer:<target>]

Display the values associated with a given registry key. The default key is HKLM\System\CurrentControlSet\Services\W32Time (the root key for the time service).

subkey:<key>displays the values associated with subkey <key> of the default key.
computer:<target>queries registry settings for computer <target>.

w32tm /query [/computer:<target>] {/source | /configuration | /peers | /status} [/verbose]

Display a computer's windows time service information.

computer:<target>query the information of <target>. If not specified, the default is the local computer.
source:display the time source.
configuration:display the configuration of run-time and where the setting comes from. In verbose mode, display the undefined or unused setting too.
peers:display a list of peers and their status.
status:display windows time service status.
verbose:set the verbose mode to display more information.

w32tm /debug {/disable | {/enable /file:<name> /size:<bytes> /entries:<value> [/truncate]}}

Enable or disable local computer windows time service private log.

disable:disable the private log.
enable:enable the private log.
file:<name>specify the absolute filename.
size:<bytes>specify the maximum size for circular logging.
entries:<value>contains a list of flags, specified by number and seperated by commas, that specify the types of information that should be logged. Valid numbers are 0 to 300. A range of numbers is valid, in addition to single numbers, such as 0-100,103,106. Value 0-300 is for logging all information.
truncate:truncate the file if it exists.

WHERE [+Server 2003|+XP]

WHERE [/R dir] [/Q] [/F] [/T] pattern...

Description: Displays the location of files that match the search pattern. By default, the search is done along the current directory and in the paths specified by the PATH environment variable.

Parameter List:

/RRecursively searches and displays the files that match the given pattern starting from the specified directory.
/QReturns only the exit code, without displaying the list of matched files. (Quiet mode)
/FDisplays the matched filename in double quotes.
/TDisplays the file size, last modified date and time for all matched files.
patternSpecifies the search pattern for the files to match. Wildcards * and ? can be used in the pattern. The "$env:pattern" and "path:pattern" formats can also be specified, where "env" is an environment variable and the search is done in the specified paths of the "env" environment variable. These formats should not be used with /R. The search is also done by appending the extensions of the PATHEXT variable to the pattern.
/?Displays this help message.

NOTE: The tool returns an error level of 0 if the search is successful, of 1 if the search is unsuccessful and of 2 for failures or errors.

Examples: WHERE /? ; WHERE myfilename1 myfile????.* ; WHERE $windir:*.* ; WHERE /R c:\windows *.exe *.dll *.bat ; WHERE /Q ??.??? ;

WHERE "c:\windows;c:\windows\system32:*.dll" ; WHERE /F /T *.dll

WHOAMI

WhoAmI has three ways of working:

Syntax 1: WHOAMI [/UPN | /FQDN | /LOGONID]

Syntax 2: WHOAMI { [/USER] [/GROUPS] [/PRIV] } [/FO format] [/NH]

Syntax 3: WHOAMI /ALL [/FO format] [/NH]

Description: This utility can be used to get user name and group information along with the respective security identifiers (SID), privileges, logon identifier (logon ID) for the current user (access token) on the local system. i.e. who is the current logged on user? If no switch is specified, tool displays the user name in NTLM format (domain\username).

Parameter List:

/UPNDisplays the user name in User Principal Name (UPN) format.
/FQDNDisplays the user name in Fully Qualified Distinguished Name (FQDN) format.
/USERDisplays information on the current user along with the security identifier (SID).
/GROUPSDisplays group membership for current user, type of account, security identifiers (SID) and attributes.
/PRIVDisplays security privileges of the current user.
/LOGONIDDisplays the logon ID of the current user.
/ALLDisplays the current user name, groups belonged to along with the security identifiers (SID) and privileges for the current user access token.
/FO formatSpecifies the output format to be displayed. Valid values are TABLE, LIST, CSV. Column headings are not displayed with CSV format. Default format is TABLE.
/NHSpecifies that the column header should not be displayed in the output. This is valid only for TABLE and CSV formats.
/?Displays this help message.

Examples: WHOAMI ; WHOAMI /? ;

WHOAMI /UPN ; WHOAMI /FQDN ; WHOAMI /LOGONID ; WHOAMI /USER ; WHOAMI /USER /FO LIST ; WHOAMI /USER /FO CSV ; WHOAMI /GROUPS ; WHOAMI /GROUPS /FO CSV /NH

WHOAMI /PRIV ; WHOAMI /PRIV /FO TABLE ; WHOAMI /USER /GROUPS ; WHOAMI /USER /GROUPS /PRIV ; WHOAMI /ALL ; WHOAMI /ALL /FO LIST ; WHOAMI /ALL /FO CSV /NH

WMIC

[Availability: +Windows XP Professional | +Windows Server 2003]

[global switches] <command>

The following global switches are available:

/NAMESPACEPath for the namespace the alias operate against.
/ROLEPath for the role containing the alias definitions.
/NODEServers the alias will operate against.
/IMPLEVELClient impersonation level.
/AUTHLEVELClient authentication level.
/LOCALELanguage id the client should use.
/PRIVILEGESEnable or disable all privileges.
/TRACEOutputs debugging information to stderr.
/RECORDLogs all input commands and output.
/INTERACTIVESets or resets the interactive mode.
/FAILFASTSets or resets the FailFast mode.
/USERUser to be used during the session.
/PASSWORDPassword to be used for session login.
/OUTPUTSpecifies the mode for output redirection.
/APPENDSpecifies the mode for output redirection.
/AGGREGATESets or resets aggregate mode.
/AUTHORITYSpecifies the <authority type> for the connection.
/?[:<BRIEF|FULL>]Usage information.

For more information on a specific global switch, type: switch-name /?

The following alias/es are available in the current role:

ALIAS- Access to the aliases available on the local system.
BASEBOARD- Base board (also known as a motherboard or system board) management.
BIOS- Basic input/output services (BIOS) management.
BOOTCONFIG- Boot configuration management.
CDROM- CD-ROM management.
COMPUTERSYSTEM- Computer system management.
CPU- CPU management.
CSPRODUCT- Computer system product information from SMBIOS.
DATAFILE- DataFile Management.
DCOMAPP- DCOM Application management.
DESKTOP- User's Desktop management.
DESKTOPMONITOR- Desktop Monitor management.
DEVICEMEMORYADDRESS- Device memory addresses management.
DISKDRIVE- Physical disk drive management.
DISKQUOTA- Disk space usage for NTFS volumes.
DMACHANNEL- Direct memory access (DMA) channel management.
ENVIRONMENT- System environment settings management.
FSDIR- Filesystem directory entry management.
GROUP- Group account management.
IDECONTROLLER- IDE Controller management.
IRQ- Interrupt request line (IRQ) management.
JOB- Provides access to the jobs scheduled using the schedule service.
LOADORDER- Management of system services that define execution dependencies.
LOGICALDISK- Local storage device management.
LOGON- LOGON Sessions.
MEMCACHE- Cache memory management.
MEMORYCHIP- Memory chip information.
MEMPHYSICAL- Computer system's physical memory management.
NETCLIENT- Network Client management.
NETLOGIN- Network login information (of a particular user) management.
NETPROTOCOL- Protocols (and their network characteristics) management.
NETUSE- Active network connection management.
NIC- Network Interface Controller (NIC) management.
NICCONFIG- Network adapter management.
NTDOMAIN- NT Domain management.
NTEVENT- Entries in the NT Event Log.
NTEVENTLOG- NT eventlog file management.
ONBOARDDEVICE- Management of common adapter devices built into the motherboard (system board).
OS- Installed Operating System/s management.
PAGEFILE- Virtual memory file swapping management.
PAGEFILESET- Page file settings management.
PARTITION- Management of partitioned areas of a physical disk.
PORT- I/O port management.
PORTCONNECTOR- Physical connection ports management.
PRINTER- Printer device management.
PRINTERCONFIG- Printer device configuration management.
PRINTJOB- Print job management.
PROCESS- Process management.
PRODUCT- Installation package task management.
QFE- Quick Fix Engineering.
QUOTASETTING- Setting information for disk quotas on a volume.
RDACCOUNT- Remote Desktop connection permission management.
RDNIC- Remote Desktop connection management on a specific network adapter.
RDPERMISSIONS- Permissions to a specific Remote Desktop connection.
RDTOGGLE- Turning Remote Desktop listener on or off remotely.
RECOVEROS- Information that will be gathered from memory when the operating system fails.
REGISTRY- Computer system registry management.
SCSICONTROLLER- SCSI Controller management.
SERVER- Server information management.
SERVICE- Service application management.
SHADOWCOPY- Shadow copy management.
SHADOWSTORAGE- Shadow copy storage area management.
SHARE- Shared resource management.
SOFTWAREELEMENT- Management of the elements of a software product installed on a system.
SOFTWAREFEATURE- Management of software product subsets of SoftwareElement.
SOUNDDEV- Sound Device management.
STARTUP- Management of commands that run automatically when users log onto the computer system.
SYSACCOUNT- System account management.
SYSDRIVER- Management of the system driver for a base service.
SYSTEMENCLOSURE- Physical system enclosure management.
SYSTEMSLOT- Management of physical connection points including ports, slots and peripherals, and proprietary connections points.
TAPEDRIVE- Tape drive management.
TEMPERATURE- Data management of a temperature sensor (electronic thermometer).
TIMEZONE- Time zone data management.
UPS- Uninterruptible power supply (UPS) management.
USERACCOUNT- User account management.
VOLTAGE- Voltage sensor (electronic voltmeter) data management.
VOLUME- Local storage volume management.
VOLUMEQUOTASETTING- Associates the disk quota setting with a specific disk volume.
VOLUMEUSERQUOTA- Per user storage volume quota management.
WMISET- WMI service operational parameters management.

For more information on a specific alias, type: alias /?

CLASS- Escapes to full WMI schema.
PATH- Escapes to full WMI object paths.
CONTEXT- Displays the state of all the global switches.
QUIT/EXIT- Exits the program.

For more information on CLASS/PATH/CONTEXT, type: (CLASS | PATH | CONTEXT) /?

X

XCOPY

Availability: +Windows 2000 Professional | +Windows 2000 Server

Copies files and directory trees.

NOTE: Xcopy is now deprecated, please use Robocopy.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/EXCLUDE:file1[+file2][+file3]...]

sourceSpecifies the file(s) to copy.
destinationSpecifies the location and/or name of new files.
/ACopies only files with the archive attribute set, doesn't change the attribute.
/MCopies only files with the archive attribute set, turns off the archive attribute.
/D:m-d-yCopies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively.
/PPrompts you before creating each destination file.
/SCopies directories and subdirectories except empty ones.
/ECopies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.
/VVerifies the size of each new file.
/WPrompts you to press a key before copying.
/CContinues copying even if errors occur.
/IIf destination does not exist and copying more than one file, assumes that destination must be a directory.
/QDoes not display file names while copying.
/FDisplays full source and destination file names while copying.
/LDisplays files that would be copied.
/GAllows the copying of encrypted files to destination that does not support encryption.
/HCopies hidden and system files also.
/ROverwrites read-only files.
/TCreates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories.
/UCopies only files that already exist in destination.
/KCopies attributes. Normal Xcopy will reset read-only attributes.
/NCopies using the generated short names.
/OCopies file ownership and ACL information.
/XCopies file audit settings (implies /O).
/YSuppresses prompting to confirm you want to overwrite an existing destination file.
/-YCauses prompting to confirm you want to overwrite an existing destination file.
/ZCopies networked files in restartable mode.
/BCopies the Symbolic Link itself versus the target of the link. (V+)
/JCopies using unbuffered I/O. Recommended for very large files. (7+)

The switch /Y may be preset in the COPYCMD environment variable.

This may be overridden with /-Y on the command line.

Valid (X)HTML, CSS