Windows CMD Commands Cheat Sheet

Quick reference Windows CMD commands you should know.

Files & Folders Comands
assoc
Fix file associations.
attrib
Change file attributes.
cd (or chdir)
Change current working directory.
comp
Perform a comparison of multiple files.
compact
Copy files from one location to another.
del (or erase)
Delete files.
dir
List files and subfolders.
expand
Expand compressed files.
fc
File compare.
find
Filter a string in files.
findstr
Search for patterns of text in files.
md (or mkdir)
Create a directory or subdirectory.
move
Move files from one directory to another.
openfiles
Display the current open files list or disconnect opened files/folders.
print
Send a text file to a printer.
rd (or rmdir)
Delete a directory.
ren (or rename)
Rename a file or directory.
replace
Replace existing or add new files to a directory.
robocopy
Copy file data from one location to another.
tree
Display tree structure of a directory.
type
Display the contents of a text file.
xcopy
Copy files and directories.
Disk & Partition Commands
active
Mark the partition with focus as active.
chkdsk
Check disk.
chkntfs
Display or modify automatic disk checking when the computer is started.
clean
Remove all partitions or volume formatting from the disk with focus.
convert
Convert a disk from one disk type to another.
create
Create partition or volume.
defrag
Locates and consolidates fragmented files on local volumes.
delete
Delete a partition or a volume.
detail
Display information about the selected disk.
diskcomp
Compare the contents of two floppy disks.
diskcopy
Copy content of the disk.
diskpart
Manage computer disks and drives.
diskperf
Start or stop disk performance counters for Performance Monitor.
extend
Extend a partition or a volume.
format
Format a disk to accept Windows files.
freedisk
Check to see if the specified amount of disk space is available before continuing with an installation process.
fsutil
Perform tasks that related to FAT and NTFS file systems.
gpt
Assign gpt attribute(s) to a partition.
label
Create, change, or delete the volume label of a disk.
list
Display a list of disks.
recover
Recover readable information from a bad or defective disk.
vol
Display the disk volume label and serial number.
Network Commands
arp
Display and modify entries in the ARP cache.
bitsadmin
Create, download or upload jobs and monitor their progress.
dnscmd
Manage DNS servers.
ftp
Connect to and use FTP.
getmac
Return the MAC address.
ipconfig
IP configuration.
ipxroute
Display and modify information about the routing tables used by the IPX protocol.
irftp
Sends files over an infrared link.
jetpack
Compact a WINS or DHCP database.
netsh
Network Shell utility.
netstat
Display network statistics.
net use
Connect/disconnect a computer to/from a shared resource
ping
View the computer name and the IP address of an endpoint computer.
tracert
Determine the route to a destination by sending ICMP packets to the destination.
TFTP
Starts TFTP client in console
System Information & Configuration Commands
date
Display or set the system date.
driverquery
Display device driver status and properties.
hostname
Display the computer hostname.
powercfg
Power configuration.
shutdown
Turn off computer.
systeminfo
Display computer system information.
time
Display or set the system time.
ver
Display Windows system version number.
Command Line Setup Commands
cls
Clear the command prompt window.
cmd
Start a new instance of the command interpreter.
color
Change the foreground and background colors in the Command Prompt window for the current session.
exit
Quit and close the command prompt.
help
Display a list of the available commands.
prompt
Change the Cmd.exe command prompt.
title
Set the Cmd.exe window title.
Applications and Processes
schtasks
Executes a command or start a scheduled application (Task Scheduler)
shutdown
Shutdowns or reboots your computer
tasklist
Lists the tasks being performed
taskkill
Stops or halts a task (to stop a task you use a PID which you can find out from TASKLIST)
reg
Starts registry editor
runas
Launches the task as another user
Try These Related Tools



Don’t document the problem, fix it.

Atli Björgvin Oddsson