.cmd
💻 CodeText-based

.cmd File — Windows Command Script

application/x-msdos-program

File Inspector

Drop any file to identify its extension and type — runs entirely in your browser

CMD

Drop a .cmd file here or click to choose

Or drop any file to identify its extension

Expected MIME type:application/x-msdos-program

Quick Facts

Extension.cmd
Full NameWindows Command Script
MIME Typeapplication/x-msdos-program
CategoryCode
TypeText-based (human-readable)
Typical Size100 B – 50 KB
First Appeared1993

What Is a .cmd File?

CMD files are Windows command scripts functionally equivalent to BAT (batch) files but processed by cmd.exe (the Windows NT command interpreter) rather than COMMAND.COM (the DOS interpreter). While BAT files are supported by both interpreters for backward compatibility, CMD files are recognized only by cmd.exe and benefit from its enhanced features including delayed variable expansion, extensions for IF and FOR commands, SETLOCAL/ENDLOCAL for variable scoping, and improved error handling with ERRORLEVEL. In practice, BAT and CMD files are nearly interchangeable on modern Windows — the choice between them is largely conventional. CMD files signal intent to use Windows NT-era features and are preferred for scripts that rely on cmd.exe-specific behavior. System administrators use CMD scripts for automated tasks, startup scripts, and deployment procedures. The CMD scripting language supports the same core features as BAT — variables, conditionals, loops, subroutines, file operations, and piping — while adding NT-specific capabilities. PowerShell has largely superseded CMD scripting for complex automation, but CMD/BAT files remain useful for simple tasks and maximum Windows version compatibility.

How to Open .cmd Files

Notepad
VS Code
Notepad++
any text editor
cmd.exe (execution)

Related File Extensions

More Code File Extensions

Other code formats you might encounter

Browse File Extensions by Category

Explore our reference of 259 file extensions with details, programs, and related formats.