Windows commands
All supported versions of Windows (server and client) have a set of Win32 console commands built in.
This set of documentation describes the Windows Commands you can use to automate tasks by using scripts or scripting tools.
Prerequisites
The information that is contained in this topic applies to:
- Windows Server 2019
- Windows Server (Semi-Annual Channel)
- Windows Server 2016
- Windows Server 2012 R2
- Windows Server 2012
- Windows Server 2008 R2
- Windows Server 2008
- Windows 10
- Windows 8.1
Command shell overview
The Command shell was the first shell built into Windows to automate routine tasks, like user account management or nightly backups, with batch (.bat) files. With Windows Script Host you could 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 you can by using the user interface. Scripts accept all Commands that are available at the command line.
Windows has two command 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 to automate IT operations.
PowerShell was designed to extend the capabilities of the Command shell to run 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, up-to-date Windows automation, we recommend using PowerShell instead of Windows Commands or Windows Script Host for Windows automation.
Note
You can also download and install PowerShell Core, the open source version of PowerShell.
Caution
Incorrectly editing the registry may severely damage your system. Before making the following changes to the registry, you should back up any valued data on the computer.
Note
To enable or disable file and directory name completion in the Command shell on a computer or user logon session, run regedit.exe and set the following reg_DWOrd value:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\completionChar\reg_DWOrd
To set the reg_DWOrd value, use the hexadecimal value of a control character for a particular function (for example, 0 9 is Tab and 0 08 is Backspace). User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.
Command-line reference A-Z
To find information about a specific command, in the following A-Z menu, click the letter that the command starts with, and then click the command name.
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
A
- active
- add
- add alias
- add volume
- append
- arp
- assign
- assoc
- at
- atmadm
- attach-vdisk
- attrib
- attributes
- auditpol
- autochk
- autoconv
- autofmt
- automount
B
- bcdboot
- bcdedit
- bdehdcfg
- begin backup
- begin restore
- bitsadmin
- bitsadmin addfile
- bitsadmin addfileset
- bitsadmin addfilewithranges
- bitsadmin cache
- bitsadmin cancel
- bitsadmin complete
- bitsadmin create
- bitsadmin examples
- bitsadmin getaclflags
- bitsadmin getbytestotal
- bitsadmin getbytestransferred
- bitsadmin getclientcertificate
- bitsadmin getcompletiontime
- bitsadmin getcreationtime
- bitsadmin getcustomheaders
- bitsadmin getdescription
- bitsadmin getdisplayname
- bitsadmin geterror
- bitsadmin geterrorcount
- bitsadmin getfilestotal
- bitsadmin getfilestransferred
- bitsadmin gethelpertokenflags
- bitsadmin gethelpertokensid
- bitsadmin gethttpmethod
- bitsadmin getmaxdownloadtime
- bitsadmin getminretrydelay
- bitsadmin getmodificationtime
- bitsadmin getnoprogresstimeout
- bitsadmin getnotifycmdline
- bitsadmin getnotifyflags
- bitsadmin getnotifyinterface
- bitsadmin getowner
- bitsadmin getpeercachingflags
- bitsadmin getpriority
- bitsadmin getproxybypasslist
- bitsadmin getproxylist
- bitsadmin getproxyusage
- bitsadmin getreplydata
- bitsadmin getreplyfilename
- bitsadmin getreplyprogress
- bitsadmin getsecurityflags
- bitsadmin getstate
- bitsadmin gettemporaryname
- bitsadmin gettype
- bitsadmin getvalidationstate
- bitsadmin help
- bitsadmin info
- bitsadmin list
- bitsadmin listfiles
- bitsadmin makecustomheaderswriteonly
- bitsadmin monitor
- bitsadmin nowrap
- bitsadmin peercaching
- bitsadmin peers
- bitsadmin rawreturn
- bitsadmin removeclientcertificate
- bitsadmin removecredentials
- bitsadmin replaceremoteprefix
- bitsadmin reset
- bitsadmin resume
- bitsadmin setaclflag
- bitsadmin setclientcertificatebyid
- bitsadmin setclientcertificatebyname
- bitsadmin setcredentials
- bitsadmin setcustomheaders
- bitsadmin setdescription
- bitsadmin setdisplayname
- bitsadmin sethelpertoken
- bitsadmin sethelpertokenflags
- bitsadmin sethttpmethod
- bitsadmin setmaxdownloadtime
- bitsadmin setminretrydelay
- bitsadmin setnoprogresstimeout
- bitsadmin setnotifycmdline
- bitsadmin setnotifyflags
- bitsadmin setpeercachingflags
- bitsadmin setpriority
- bitsadmin setproxysettings
- bitsadmin setreplyfilename
- bitsadmin setsecurityflags
- bitsadmin setvalidationstate
- bitsadmin suspend
- bitsadmin takeownership
- bitsadmin transfer
- bitsadmin util
- bitsadmin wrap
- bootcfg
- break
C
- cacls
- call
- cd
- certreq
- certutil
- change
- chcp
- chdir
- chglogon
- chgport
- chgusr
- chkdsk
- chkntfs
- choice
- cipher
- clean
- cleanmgr
- clip
- cls
- cmd
- cmdkey
- cmstp
- color
- comp
- compact
- compact vdisk
- convert
- copy
- cprofile
- create
- cscript
D
- date
- dcgpofix
- defrag
- del
- delete
- detach vdisk
- detail
- dfsdiag
- dfsrmig
- diantz
- dir
- diskcomp
- diskcopy
- diskpart
- diskperf
- diskraid
- diskshadow
- dispdiag
- dnscmd
- doskey
- driverquery
E
- echo
- edit
- endlocal
- end restore
- erase
- eventcreate
- eventquery
- eventtriggers
- Evntcmd
- exec
- exit
- expand
- expand vdisk
- expose
- extend
- extract
F
- fc
- filesystems
- find
- findstr
- finger
- flattemp
- fondue
- for
- forfiles
- format
- freedisk
- fsutil
- ftp
- ftp append
- ftp ascii
- ftp bell
- ftp binary
- ftp bye
- ftp cd
- ftp close
- ftp debug
- ftp delete
- ftp dir
- ftp disconnect
- ftp get
- ftp glob
- ftp hash
- ftp lcd
- ftp literal
- ftp ls
- ftp mget
- ftp mkdir
- ftp mls
- ftp mput
- ftp open
- ftp prompt
- ftp put
- ftp pwd
- ftp quit
- ftp quote
- ftp recv
- ftp remotehelp
- ftp rename
- ftp rmdir
- ftp send
- ftp status
- ftp trace
- ftp type
- ftp user
- ftp verbose
- ftp mdelete
- ftp mdir
- ftype
- fveupdate
G
H
I
J
K
- klist
- ksetup
- ksetup addenctypeattr
- ksetup addhosttorealmmap
- ksetup addkdc
- ksetup addkpasswd
- ksetup addrealmflags
- ksetup changepassword
- ksetup delenctypeattr
- ksetup delhosttorealmmap
- ksetup delkdc
- ksetup delkpasswd
- ksetup delrealmflags
- ksetup domain
- ksetup dumpstate
- ksetup getenctypeattr
- ksetup listrealmflags
- ksetup mapuser
- ksetup removerealm
- ksetup server
- ksetup setcomputerpassword
- ksetup setenctypeattr
- ksetup setrealm
- ksetup setrealmflags
- ktmutil
- ktpass
L
- label
- list
- load metadata
- lodctr
- 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 api
- logman update cfg
- logman update counter
- logman update trace
- logoff
- lpq
- lpr
M
- macfile
- makecab
- manage bde
- manage bde status
- manage bde on
- manage bde off
- manage bde pause
- manage bde resume
- manage bde lock
- manage bde unlock
- manage bde autounlock
- manage bde protectors
- manage bde tpm
- manage bde setidentifier
- manage bde forcerecovery
- manage bde changepassword
- manage bde changepin
- manage bde changekey
- manage bde keypackage
- manage bde upgrade
- manage bde wipefreespace
- mapadmin
- md
- merge vdisk
- mkdir
- mklink
- mmc
- mode
- more
- mount
- mountvol
- move
- mqbkup
- mqsvc
- mqtgsvc
- msdt
- msg
- msiexec
- msinfo32
- mstsc
N
- nbtstat
- netcfg
- net print
- netsh
- netstat
- nfsadmin
- nfsshare
- nfsstat
- nlbmgr
- nslookup
- nslookup exit Command
- nslookup finger Command
- nslookup help
- nslookup ls
- nslookup lserver
- nslookup root
- nslookup server
- nslookup set
- nslookup set all
- nslookup set class
- nslookup set d2
- nslookup set debug
- nslookup set domain
- nslookup set port
- nslookup set querytype
- nslookup set recurse
- nslookup set retry
- nslookup set root
- nslookup set search
- nslookup set srchlist
- nslookup set timeout
- nslookup set type
- nslookup set vc
- nslookup view
- ntbackup
- ntcmdprompt
- ntfrsutl
O
P
- pagefileconfig
- path
- pathping
- pause
- pbadmin
- pentnt
- perfmon
- ping
- pnpunattend
- pnputil
- popd
- powershell
- powershell ise
- prncnfg
- prndrvr
- prnjobs
- prnmngr
- prnport
- prnqctl
- prompt
- pubprn
- pushd
- pushprinterconnections
- pwlauncher
Q
R
- rcp
- rd
- rdpsign
- recover
- recover disk group
- refsutil
- reg
- regini
- regsvr32
- relog
- rem
- remove
- ren
- rename
- repair
- replace
- rescan
- reset
- retain
- revert
- rexec
- risetup
- rmdir
- robocopy
- route ws2008
- rpcinfo
- rpcping
- rsh
- rundll32
- rundll32 printui
- rwinsta
S
- san
- sc config
- sc create
- sc delete
- sc query
- schtasks
- scwcmd
- secedit
- select
- serverceipoptin
- servermanagercmd
- serverweroptin
- set environmental variables
- set shadow copy
- setx
- sfc
- shadow
- shift
- showmount
- shrink
- shutdown
- simulate restore
- sort
- start
- subcommand set device
- subcommand set drivergroup
- subcommand set drivergroupfilter
- subcommand set driverpackage
- subcommand set image
- subcommand set imagegroup
- subcommand set server
- subcommand set transportserver
- subcommand set multicasttransmission
- subcommand start namespace
- subcommand start server
- subcommand start transportserver
- subcommand stop server
- subcommand stop transportserver
- subst
- sxstrace
- sysocmgr
- systeminfo
T
- takeown
- tapicfg
- taskkill
- tasklist
- tcmsetup
- telnet
- tftp
- time
- timeout
- title
- tlntadmn
- tpmtool
- tpmvscmgr
- tracerpt
- tracert
- tree
- tscon
- tsdiscon
- tsecimp
- tskill
- tsprof
- type
- typeperf
- tzutil
U
V
W
- waitfor
- wbadmin
- wbadmin delete catalog
- wbadmin delete systemstatebackup
- wbadmin disable backup
- wbadmin enable backup
- wbadmin get disks
- wbadmin get items
- wbadmin get status
- wbadmin get versions
- wbadmin restore catalog
- wbadmin start backup
- wbadmin start recovery
- wbadmin start sysrecovery
- wbadmin start systemstatebackup
- wbadmin start systemstaterecovery
- wbadmin stop job
- wdsutil
- wecutil
- wevtutil
- where
- whoami
- winnt
- winnt32
- winpop
- winrs
- winsat mem
- winsat mfmedia
- wmic
- writer
- wscript