.cmd File — Windows Command Script
application/x-msdos-program
Drop any file to identify its extension and type — runs entirely in your browser
Drop a .cmd file here or click to choose
Or drop any file to identify its extension
application/x-msdos-programQuick Facts
| Extension | .cmd |
| Full Name | Windows Command Script |
| MIME Type | application/x-msdos-program |
| Category | Code |
| Type | Text-based (human-readable) |
| Typical Size | 100 B – 50 KB |
| First Appeared | 1993 |
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
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.