A complete reference — Windows Command Prompt
The Command Codex
Every command gets one card: what it does, an example, its key flags, and a practice line. Read the card once, cover the practice line, and type it from memory.
New here? Start with the introduction — opening the prompt, the working directory, and asking for help. ★ marks a multi-verb power tool. ⚠ marks something destructive.
138 commands
02Folders, Disks & Storage
mkdir / mdCreate a new folder.rmdir / rd⚠Remove a folder.format⚠Format a disk for use with Windows. ⚠ Destroys all data on the target.chkdskCheck a disk for errors and file system problems.chkntfsDisplay or change disk-checking behavior at boot time.diskpart★⚠Interactive disk-partitioning tool. Manages disks, partitions, and volumes.mountvolCreate, delete, or list a volume mount point.labelCreate, change, or delete the volume label of a disk.volDisplay the disk volume label and serial number.convertConvert a FAT volume to NTFS without losing data.compactDisplay or alter NTFS compression of files and folders.fsutil★Perform file-system tasks: quotas, hard links, sparse files, reparse points.defragLocate and consolidate fragmented files on local volumes.diskperfManage the disk performance counters.recoverRecover readable data from a bad or defective disk.modeConfigure system devices, especially serial ports and the console.
03System Info & Diagnostics
systeminfoDisplay detailed configuration information about a computer.hostnameDisplay the computer's name.whoamiDisplay the current user, domain, and login information.verDisplay the Windows version.driverqueryList all installed device drivers and their properties.msinfo32Launch the System Information graphical tool.dispdiagGenerate a diagnostic report of the display subsystem.typeperfWrite performance counter data to the console or a log file.perfmonLaunch the Performance Monitor graphical tool.tracerptProcess trace logs or real-time trace data into reports.wevtutil★⚠Manage Windows event logs and publishers.eventcreateAdd a custom event to a Windows event log.logman★Manage and schedule performance counter and trace logs.pnputilManage Plug and Play device drivers.sfcScan and repair protected system files.verifierManage the Driver Verifier for testing driver stability.tzutilDisplay or set the current time zone.wmicQuery system information via Windows Management Instrumentation. Microsoft is steering this functionality toward PowerShell — still…
04Processes, Services & Scheduling
tasklistList currently running processes.taskkillEnd a running process by name or process ID.sc★Communicate with the Service Controller — install, query, and control services.schtasksSchedule commands and programs to run at specified times.atSchedule commands to run at a specified time. Superseded by schtasks.startStart a separate window to run a program or command.shutdownShut down, restart, or log off the local or a remote computer.logoffLog off the current session.msgSend a message to a user on the local or a remote system.waitforSend or wait for a signal on a network, used to synchronize batch files.timeoutPause a batch file for a specified number of seconds.mstscLaunch the Remote Desktop Connection client.powershellLaunch the PowerShell shell, or run a single PowerShell command from cmd.exe.
05Networking
ipconfigDisplay and manage the PC's network configuration.pingTest connectivity to a network host.tracertTrace the route packets take to a destination.pathpingCombine ping and tracert, showing loss statistics at each hop.nslookup★Query DNS servers for domain name or IP information.netstatDisplay active network connections and listening ports.arpDisplay and modify the ARP cache (IP-to-MAC mappings).routeDisplay and modify the local IP routing table.getmacDisplay the MAC address of network adapters.nbtstatDisplay NetBIOS over TCP/IP protocol statistics.netsh★Configure network components through named contexts.net★Manage users, shares, and network services.telnetConnect to a remote system using the Telnet protocol. Optional feature — must be enabled first.ftp★Transfer files to and from an FTP server.tftpTransfer files using the simpler Trivial FTP protocol.rpcpingTest connectivity to an RPC server.
06Security, Users & Permissions
icaclsDisplay or modify access control lists (ACLs) for files and folders.caclsDisplay or modify file ACLs. Superseded by icacls.takeownTake ownership of a file or folder.cipher⚠Display or alter NTFS encryption of files/folders; can also wipe free space.runasRun a command as a different user.cmdkeyCreate, list, and delete stored user credentials.klistList cached Kerberos tickets.auditpol★View and set audit policy settings.secedit★Configure and analyze system security using security templates.gpupdateRefresh local and Active Directory group policy settings.gpresultDisplay the resultant set of group policy applied to a user or computer.
07Registry
08Print & Devices
printPrint a text file, or manage a print queue.prncnfgConfigure or display printer settings.prndrvrAdd, delete, or list printer drivers.prnjobsPause, resume, or cancel print jobs.prnmngrAdd, delete, and list printers.prnportCreate, delete, and list standard TCP/IP printer ports.prnqctlPrint a test page, pause, or resume a printer queue.lpqDisplay the status of a print queue on a system running LPD.lprSend a print job to a printer sharing LPD.
09Backup & Recovery
10Scripting & Batch
@echo offStop a batch file from printing each command as it runs.echoPrint text to the screen, or toggle command echoing.remInsert a comment line, ignored when the batch file runs.pauseStop and wait for a keypress before continuing.callRun another batch file (or subroutine) from within a batch file.gotoJump to a labeled line within a batch file.ifPerform conditional processing in a batch file.forLoop over a set of files, folders, or values.choicePrompt the user to pick one option from a list.set / setlocal / endlocalDisplay, create, or change environment variables; localize changes to a batch file's scope.shiftShift the position of batch file parameters (%1 becomes %0, etc.).cscriptRun a script under Windows Script Host in console mode.wscriptRun a script under Windows Script Host in windowed mode.cmdStart a new instance of the Command shell.doskeyRecall and edit command lines; create command macros.
11Environment & Console Customization
No commands match that filter.