All supported versions of Windows and Windows Server have a set of built-in Win32 console commands. This documentation set describes Windows commands that you can use to automate tasks by using scripts or scripting tools.
Command-line
shells
Windows has two command-line shells: the command shell and PowerShell. Each shell is a software program that provides direct communication between you and the operating system or application, providing an environment for automating IT operations.
The
command shell was the first shell built into Windows to automate routine tasks, such as user account management or nightly backups, with batch files (.bat). With Windows Script Host, you can run more sophisticated scripts in the command shell. For more information, see cscript or wscript. You can perform operations more efficiently by using scripts than by using the user interface. The scripts accept all commands that are available on the command line.
PowerShell was designed to extend the capabilities of the command shell to execute PowerShell commands called cmdlets. Cmdlets are similar to Windows commands, but provide a more extensible scripting language. You can run Windows commands and PowerShell cmdlets in PowerShell, but the command shell can only run Windows commands and not PowerShell cmdlets.
For the most robust and up-to-date Windows Automation, we recommend that you use PowerShell instead of Windows Commands or Windows Script Host for Windows Automation.
You can find a reference to the exit and error codes for Windows commands in the Debugging system error codes articles that may be helpful in understanding the errors that occur. Windows commands also include command redirection operators. For more information about using them, see Using Command Redirection Operators.
Automatic completion of the command shell file and directory
name
You can configure the command shell to automatically populate file and directory names on a computer or user session when a specified control character is pressed. By default, this control character is set to be the tab key for file and directory names, although they may be different. To change this control character, run regedit.exe and navigate to any of the following registry keys and entries, depending on whether you want to change the value only for the current user or for all users on the computer.
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor\CompletionChar HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor\PathCompletionChar HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\CompletionChar HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\PathCompletionChar
Set these values to the control character you want to use. See virtual key codes for a complete list. To disable a particular ending character in the registry, use the space value (0x20) because it is not a valid control character. The value type for this registry entry is REG_DWORD and can be specified by using a hexadecimal or decimal value.
You can also enable or disable the termination of file and directory names by instance of a command shell by running cmd.exe with the /F:ON or /F:OFF parameter and switch. If name ending is enabled with the /F:ON parameter and the switch, the two control characters used are Ctrl-D to complete the directory name and Ctrl-F to complete the file name. User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.
A to Z
command-line reference
To find information about a specific command, from the next menu from A to Z, select the letter with which the command begins, and then select the name of the command. A
| M S C | D | E | F | G | H | I | J | K | L | M | N | OR | P | P | R | S | T | U | V | W | X | AND | Z
A
- active
- alias
- add
- append
- arp
- assign
- assoc
- at
- atmadm
- attach-vdisk
- attrib
-
- attributes disk attributes
- volume
-
- auditpol
- auditpol set
restore
- autochk
- autoconv autofmt
- automount
add add
add
volume
attributes
auditpol auditpol audit pol backup auditpol clear auditpol get auditpol list auditpol remove auditpol resourcesacl
B
bcdboot bcdedit bdehdcfg bdehdcfg driveinfo bdehdcfg newdriveletter bdehdcfg silent bdehdcfg restart bdehdcfg
-
- size
- bdehdcfg
- backup
- start restore
-
- bitsadmin addfile
- addfilewithranges
-
- and list bitsadmin
- setexpirationtime
- cache and
cache and
bitsadmin
- cancel
- bitsadministration examples
- getaclflags
- getbytestotal bitsadmin getbytestransferred bitsadmin getclientcertificate
- getcompletiontime
- bitsadmin
- geterrorcount
- getfilestransferred
- gethelpertokensid
- getminretrydelay
- getmodificationtime bitsadmin getnoprogressout
- bitsadmin
- getnotifyinterface
- getpeercachingflags
- getproxybypasslist bitsadmin getproxylist
- getproxyusage bitsadmin getreplyfilename bitsadmin getreplyprogress
- getsecurityflags
- getstate bitsadmin gettemporaryname
- gettype
- GetValidationState
- listfiles
- makecustomheaderswriteonly
- nowrap
-
- peercaching and set configurationflags
bitsadmin peers
bitsadmin peers and clear bitsadmin peers and discover bitsadmin peers and help bitsadmin peers and list bitsadmin rawreturn bitsadmin removeclientcertificate bitsadmin removecredentials bitsadmin replaceremoteprefix bitsadmin reset bitsadmin resume bitsadmin setaclflag bitsadmin
-
- setclientcertificatebyid bitsadmin setclientcertificatebyclient setclientcertificatebyname
- setdisplayname
- sethelpertoken
- sethttpmethod
- setmaxdownloadtime
- setminretrydelay
- bitsadmin
- setnoprogresstimeout
- setnotifyflags
- setproxysettings
- setreplyfilename
- setsecurityflags
- setvalidationstate
- takeownership
-
- util y enableanalyticchannel
- and setieproxy
- util and version
bitsadmin util and getieproxy bitsadmin util and help bitsadmin util and repairservice bitsadmin util
bitsadmin
- bitsadmin
bitsadmin addfileset
bitsadmin
bitsadmin cache bitsadmin cache bitsadmin cache and delete bitsadmin cache and deleteurl bitsadmin cache and getexpirationtime bitsadmin cache and getlimit bitsadmin cache and help bitsadmin cache and information bitsadmin cache
setlimit bitsadmin cache and clear bitsadmin cancel bitsadmin cache and setlimit bitsadmin
bitsadmin complete bitsadmin create
bitsadmin
bitsadmin
bitsadmin
bitsadmin getcreationtime bitsadmin getcustomheaders bitsadmin getdescription bitsadmin getdisplayname
geterror bitsadmin
bitsadmin getfilestotal
bitsadmin
bitsadmin gethelpertokenflags bitsadmin
bitsadmin gethttpmethod bitsadmin getmaxdownloadtime bitsadmin
bitsadmin
bitsadmin getnotifycmdline bitsadmin getnotifyflags
bitsadmin getowner bitsadmin
bitsadmin getpriority bitsadmin
bitsadmin
bitsadmin
bitsadmin
bitsadmin
bitsadmin bitsadmin
bitsadmin help bitsadmin information bitsadmin bitsadmin bitsadmin
bitsadmin
bitsadmin monitor bitsadmin
bitsadmin peercaching bitsadmin peercaching and getconfigurationflags bitsadmin peercaching and help bitsadmin peercaching and
setconfigurationflags
bitsadmin
bitsadmin setcredentials bitsadmin setcustomheaders bitsadmin
bitsadmin
bitsadmin sethelpertokenflags bitsadmin
bitsadmin
bitsadmin
bitsadmin setnotifycmdline bitsadmin
bitsadmin setpeercachingflags bitsadmin setpriority bitsadmin
bitsadmin
bitsadmin
bitsadmin
bitsadmin suspend bitsadmin
bitsadmin transfer bitsadmin util bitsadmin
-
- dbg1394
- debugging
- raw bootcfg
- rmsw
- bootcfg
- timeout
bootcfg
bootcfg default bootcfg remove bootcfg ems bootcfg query bootcfg
- break
destination start
bitsadmin
wrap bootcfg bootcfg addsw bootcfg copy bootcfg
C
- cacls
- call
- cd
- certreq certutil
-
- logon
change change user
- chcp chdir
- chglogon chgport
- chgusr
- chkdsk
- chkntfs
- cipher
- clean
- cleanmgr
- clip
- cls
- cmd
- cmstp
- color
- comp
- compact vdisk
-
- basic
- gpt convert
- mbr
convert dynamic convert
- copy
- extended create
- partition logical
- msr create partition
- mirroring
- simple volume create
- volume stripe
create partition
primary create volume
create raid
volume create volume volume create
- cscript
change change
choice
cmdkey
compact
convert
create create partition efi create partition
D
- date
- dcgpofix
- defragment
-
- shadows
- delete volume
- detach
-
- detail Partition
- vdisk Detail Volume
Detail
- testdcs dfsdiag testdfsconfig dfsdiag testdfsintegrity dfsdiag testreferral dfsdiag
- testsites dfsrmig
- diantz
- dir
- diskcomp
- diskcopy diskpart
- diskperf
- diskraid
- diskshadow
- dispdiag
- dnscmd
- doskey
- driverquery
delete delete disk delete partition delete
vdisk detail detail disk detail
dfsdiag dfsdiag
E
- echo
- edit
- endlocal
- end restore
- erase eventcreate
- Evntcmd
- exec
- exit
- expand
- vdisk
- expose
- extend
- extract
expand
F
- fc
- filesystems
- find
- findstr
- finger
- flattemp
- fondue
- for
- forfiles
- format
- freedisk
-
- fsutil 8dot3name
- Behavior of
- volume
- fsutil
- wim
fsutil fsutil file fsutil dirty fsutil fsinfo fsutil hardlink fsutil objectid fsutil quota fsutil repair fsutil reparsepoint fsutil resource fsutil sparse fsutil tiering fsutil transaction fsutil usn
fsutil
-
- append
- ascii
- binary
- bye
- ftp
- cd
- debug
- disconnect ftp get
- glob
- literal
- mget ftp mkdir
- mls
- mput ftp open
- indicator
- put
- pwd
- recv
- ftp remotehelp
- rename
- ftp rmdir
- ftp send
- type
- user
- verbose
- mdelete ftp mdir
- ftype
ftp
ftp bell ftp
ftp
ftp close ftp
ftp delete ftp dir ftp
ftp
ftp hash lcd ftp
ftp ls ftp
ftp
ftp
ftp
ftp
ftp exit ftp quote ftp
ftp
ftp status ftp trace ftp
ftp
ftp
ftp
- fveupdate
fsutil
ftp ftp
G
- getmac gettype
- goto
- gpfixup gpresult
- gpt gpupdate
- graftabl
H
- help
- helpctr
- hostname
I
- icacls
- if
- import (shadowdisk
- import (diskpart)
- inactive
- ipconfig ipxroute
- irftp
)
J
- jetpack
K
klist ksetup ksetup addenctypeattr ksetup addhosttorealmmap ksetup addkdc ksetup addkpasswd ksetup
- addrealmflags ksetup changepassword ksetup delenctypeattr ksetup delhosttorealmmap ksetup delkdc
-
- ksetup delkpasswd
- ksetup
- dumpstate
- mapuser
- setcomputerpassword ksetup setenctypeattr
- setrealm ksetup setrealmflags
delrealmflags ksetup domain ksetup
ksetup getenctypeattr ksetup listrealmflags ksetup
ksetup removerealm ksetup server ksetup
ksetup
- ktmutil
- ktpass
l
- label list
- providers list
- shadows list
- list Writers
- load metadata
- lodctr
-
- api
- logman
- update
- cfg
- logman
- counter
- logman update trace logoff
update
- lpq lpr
- M
logman logman create logman create alert logman create api logman create cfg logman create counter logman create trace logman delete logman import and logman export logman query logman start and logman stop logman update logman update alert logman update
macfile makecab manage bde manage bde status manage bde on manage bde off manage bde pause manage bde resume manage bde lock manage bde lock manage bde
-
- setidentifier
- bde
- bde
- forcerecovery
- changepin
- keypackage
- bde
- manage bde
- wipefreespace
manage
forcerecovery manage
manage bde changepassword manage bde
manage bde changekey manage bde keypackage manage bde
manage
update
- mapadmin
- md
- merge vdisk
- mmc
- mode
- more
- mount
- mountvol
- move
- mqtgsvc
- msdt
- msiexec
- msinfo32
- mstsc
- nbtstat
unlock manage bde autounlock manage bde protectors manage bde tpm manage bde
mkdir mklink
mqbkup mqsvc
msg
n
- netcfg
- netdom
- net print
- netsh netstat
- nfsstat
- nlbmgr
- nltest
- all
- debug
- nslookup set
- srchlist
- set vc nslookup
- view
nslookup set class nslookup set d2 nslookup set
nslookup set domain nslookup set port nslookup set querytype nslookup set recurse nslookup set retry nslookup set root nslookup set search
nslookup set timeout nslookup set type nslookup
- ntbackup
- ntcmdprompt
- ntfrsutl
nfsadmin nfsshare
nslookup nslookup exit Command nslookup finger Command nslookup help nslookup ls nslookup lserver nslookup root nslookup
Server nslookup set nslookup set
O
offline disk
-
- offline
volume online
disk
-
- volume
- openfiles
online
P
- pagefileconfig
- path
- pathping
- pause
- pbadmin pentnt
- ping
- pktmon
- popd
- PowerShell
- ise
- prncnfg
- prndrvr prnjobs
- prnmngr
- prnport prnqctl
- prompt
- pubprn
- pushd pushprinterconnections
- pwlauncher pwsh
perfmon
pnpunattend pnputil
PowerShell
Q
- qappsrv qprocess
- query process query
- session query
- termserver
- user
query
- quser
- qwinsta
query
R
- rd rdpsign
- recover
- disk group
- refsutil
-
- reg add
- copy
- export
- save
- reg
- unload
reg compare reg
reg delete reg
reg import reg load reg query reg restore reg
- regsvr32
- relog rem
- remove
- ren
- rename
- repadmin
- repair
- repair bde
- replace rescan
-
- session
- retain
- revert
- rexec
- risetup
- rmdir
- robocopy
- route ws2008
- rpcinfo rpcping
- rsh
- rundll32
- printui
- rwinsta
recover
reg reg
regini
reset session reset
rundll32
S
- san
- config
- create
- delete
- sc query
- schtasks
-
- rollback scwcmd
- transform
- scwcmd view
secedit secedit analyze secedit configure secedit export secedit generaterollback
-
- secedit
- secedit
- validate
import
- disk select partition select
- vdisk
- select volume
- serverceipoptin
- servermanagercmd
- serverweroptin
- environment variables
- copy set
- context
- id
- setlocal
- option
- verbose
set
set metadata set
set
setx
- sfc
- shadow
- shift
- showmount
- shrink
- shutdown
- simular restore
- sort
- drivergroupfilter subcommand set driverpackage
- image
- imagegroup
- set
- multicasttransmission
- namespace
- subcommand
- start server
- server
- subcommand
- transportserver
- subst
- sxstrace
- sysocmgr systeminfo
sc
sc
sc
scwcmd scwcmd analyze scwcmd configure scwcmd register scwcmd
secedit
select select
set
set shadow
start subcommand set device subcommand set drivergroup subcommand set drivergroup subcommand set
subcommand set
subcommand set set
subcommand
subcommand set transportserver subcommand
subcommand start
subcommand start transportserver subcommand stop
stop
t
- takeown
- tapicfg
- taskkill tasklist
- tcmsetup
-
- set
- telnet
- state
- telnet unset
- tftp
- timeout
- title
- tlntadmn
- tpmtool tpmvscmgr
- tracerpt
- tracert
- tree
- tscon tsdiscon tsecimp
- tskill
- tsprof
- typeperf
- tzutil
telnet telnet close telnet display
telnet open telnet exit telnet send telnet
type
U
- unexpose
- uniqueid
- unlodctr
V
ver verifier verify vol vssadmin vssadmin delete shadows vssadmin list shadows vssadmin
-
- list writers
- vssadmin resize shadowstorage
W
waitfor wbadmin wbadmin delete catalog wbadmin
-
- delete systemstatebackup
- disable
- wbadmin
- enable
- wbadmin start systemstaterecovery
- wbadmin stop
- wdsutil
- job
wbadmin
backup
backup
wbadmin get wbadmin disks get wbadmin items get wbadmin status get wbadmin versions restore wbadmin catalog start wbadmin backup start wbadmin recovery start sysrecovery wbadmin start systemstatebackup
- wecutil
- wevtutil
- where
- whoami
- winnt
- winnt32
- winrs
- mem winsat
- mfmedia
- wmic
- writer
- wscript
winsat
x
- xcopy