esc
Anthology / Yagnipedia / cmd

cmd

The Shell That Survived by Being Impossible to Kill
Technology · First observed 1987 (Microsoft, OS/2 — descended from COMMAND.COM, which descended from CP/M's CCP, which descended from the primordial void of computing where nobody expected better) · Severity: Chronic — not painful enough to justify the effort of replacing it, not good enough to justify the effort of using it

cmd.exe is the command-line interpreter for Windows. It is descended from COMMAND.COM, which shipped with MS-DOS in 1981, which was descended from CP/M’s Console Command Processor, which was written in the 1970s for 8-bit microcomputers.

cmd has not evolved significantly since. This is not an exaggeration. The core of cmd — its syntax, its capabilities, its batch file language — is recognizably the same tool that ran on MS-DOS 5.0 in 1991. The window has a title bar now. The font is better. The underlying tool is the same tool.

cmd is the cockroach of shells. It cannot be killed. It has survived every attempt to replace it. It will be running on the last Windows machine after the heat death of the universe, displaying C:\> to no one, waiting for a command that will never come.

“cmd is not a shell. cmd is a proof that software can survive indefinitely if the cost of removing it exceeds the cost of enduring it.”
— A Passing AI, reviewing Windows system internals

The Syntax

cmd’s batch file language is the worst mainstream scripting language in computing. This is not an opinion. This is a consensus shared by everyone who has written a batch file, including — one suspects — the person who designed the syntax, who presumably did so under duress or while thinking about something else.

Highlights:

The Persistence

Microsoft has tried to replace cmd. Twice.

First, PowerShell (2006). A real shell with a real scripting language, objects in pipelines, and a verb-noun syntax that is logically consistent if aesthetically unfortunate. PowerShell was supposed to replace cmd for system administration. PowerShell has not replaced cmd. PowerShell is used by system administrators who have accepted the learning curve. cmd is used by everyone else, which is everyone.

Second, Windows Terminal (2019). Not a replacement for cmd — a better window to run cmd in. Tabs. Fonts. Colours. Profiles. A modern terminal emulator wrapped around the same cmd.exe that has existed since 1987. The window is better. The shell inside is the same.

Third, WSL (Windows Subsystem for Linux, 2016). The nuclear option: run actual Linux inside Windows, with actual Bash, with actual Unix tools. This is not replacing cmd. This is admitting that the entire approach was wrong and starting over with someone else’s shell.

cmd persists through all of this because cmd is the shell that every batch file, every .bat script, every corporate login script, every legacy automation tool expects. Removing cmd would break everything. Replacing cmd requires replacing everything that depends on cmd, which is everything.

Measured Characteristics

Year created:                            1987 (cmd.exe for OS/2), ancestor: 1981 (COMMAND.COM)
Creator:                                 Microsoft
Scripting language:                      batch files (the worst mainstream scripting language)
GOTO support:                            yes (in 2026, seriously)
Variable syntax:                         %var%, %%var, !var! (depending on context)
for /f comprehensibility:                zero
Replacements Microsoft has built:        PowerShell (2006), WSL (2016), Windows Terminal (2019)
Replacements that have killed cmd:       zero
The backslash:                           \ (instead of /, because MS-DOS chose differently in 1981)
Default colour scheme:                   white on black (the saddest prompt in computing)
Probability of cmd still existing in 2050: 100%
The thing that keeps cmd alive:          legacy batch files (millions of them, in production, unreplaceable)

See Also