Show Menu
Cheatography

Windows CMD Commands Cheat Sheet (DRAFT) by

Windows CMD Commands

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Files & Folders Management

copy <op­tio­ns> <sr­c> <de­st>
Copies files to another location.
cd <di­rec­tor­y>
Changes directory.
del or erase <op­tio­ns> <fi­les>
Deletes files.
dir <pa­th> <op­tio­ns>
Displays files and folders in the current directory.
edit <fi­len­ame>
Starts the file editor.
expand <so­urc­e> <de­sti­nat­ion>
Decomp­resses compressed files.
fc <op­tio­ns> <file 1> <file 2>
Compares files and shows the differ­ences between them.
find <st­rin­g> <fi­le>
Finds a text string in a file.
md or makedir <pa­th>
Creates a new folder.
move <op­tio­ns> <sr­c> <de­st>
Moves files from one folder to another.
openfiles
Manages opened local or network files.
print <fi­len­ame> <pa­th>
Prints out the contents of a text file.
rd or rmdir <pa­th>
Deletes a folder.
ren or rename <pa­th>­<ol­dna­me> <ne­wna­me>
Renames a file or folder.
replace <ol­dpa­th> <ne­wpa­th>
Replaces files in one directory with files of the same name in another directory (overw­rites).
robocopy <sr­c> <de­st> <fi­le> <op­tio­ns>
Uses an advanced tool to copy files and direct­ories.
tree <op­tio­ns> <pa­th>
Displays the directory structure of a disk or folder.
type <file path>
Displays the contents of text files.
xcopy <sr­c> <de­st> <op­tio­ns>
Copies files and directory trees, often used for more complex copy operat­ions.

Command Line Setup

cls
Clears the screen.
cmd <op­tio­ns> <co­mma­nd>
Opens another command prompt window.
color <ba­ckg­rou­nd>­<fo­nt>
Sets the text and background color in the command prompt.
exit <op­tio­ns>
Exits the command prompt.
help <co­mma­nd>
Launches the CMD help interface.
prompt <st­rin­g/v­ari­abl­es>
Changes the command line prompt.
title <st­rin­g>
Assigns a title to the current command prompt session.

Disks Management

chkdisk <vo­lum­e> <op­tio­ns>
Checks disk integrity and shows statis­tics.
chkntfs <vo­lum­e>
Displays or changes execution of disk check at boot.
compact <op­tio­ns> <fi­le>
Displays and changes the compre­ssion of files in NTFS partit­ions.
convert <vo­lum­e>: /<t­ype>
Converts FAT disk volume to NTFS.
defrag <vo­lum­e> <op­tio­ns>
Starts disk defrag­men­tation.
diskpart
Displays and adjusts disk partition proper­ties.
format <ty­pe>
Formats a disk or partition.
fsutil <su­bco­mma­nd>
Displays and configures file system proper­ties.
label /mp <vo­lum­e> <la­bel>
Creates, changes, or deletes a disk volume label.
recover <dr­ive­>:<­pat­h><­fil­ena­me>
Recovers data from a damaged or bad disk.
vol <dr­ive>
Displays the volume label and serial number of the disk.
 

Network Management

arp <op­tio­n> <ad­dre­ss>
Displays a table with IP addresses converted into physical (MAC) addresses.
getmac <op­tio­ns>
Displays the MAC address of the network adapter.
ipconfig <op­tio­ns>
Shows inform­ation about network interfaces and IP config­ura­tion.
netsh <op­tio­ns>
nslookup <ho­st> <co­mma­nd> <op­tio­ns> – Finds the IP address for a resource name.
Starts the network settings control program.
ping <op­tio­ns> <ho­st>
Sends ICMP requests to the target host to check its availa­bility.
route <op­tio­ns> <co­mma­nd> <va­lue>
Displays network route tables.
tftp
Starts the TFTP client in the command prompt.
tracert <op­tio­ns> <de­st>
Finds the network path for packets traveling to a destin­ation.

System Inform­ation

date <op­tio­ns>
Outputs or sets the current date.
driver­query <op­tio­ns>
Displays the current state and properties of device drivers.
gpresult
Displays the currently applied group policies (RSoP).
gpupdate
Updates group policies.
hostname
Displays the name of the computer.
systeminfo <op­tio­ns>
Shows config­uration inform­ation about your computer.
time <op­tio­ns>
Displays or sets the system time.
ver
Allows you to view the Windows version.

Applic­ations & Processes

reg
Starts the registry editor.
runas /user:­<us­ern­ame> "­<co­mma­nd>­"
Launches a task as another user.
schtasks /<s­ubc­omm­and>
Executes a command or starts a scheduled applic­ation (Task Schedu­ler).
shutdown <op­tio­ns>
Shuts down or reboots your computer.
taskkill <op­tio­ns> <ta­sk/­pro­ces­s>
Stops or halts a task.
tasklist <op­tio­ns>
Lists the tasks being performed on your computer.