Skip to content

.cmd · text/plain

What is a .cmd file?

Command Script

About the format

A .cmd file is a Windows command script, for practical purposes, a .bat file with a different extension. Both are plain text executed by cmd.exe; the differences are trivia (the .cmd extension arrived with Windows NT, and errorlevel handling differs subtly in edge cases). Everything about batch files applies unchanged: double-clicking runs the script immediately with your permissions; the content is readable text, so the safe move with any .cmd you didn't write is right-click → Edit and actually read it; and the malicious patterns to look for are downloads (curl, certutil -urlcache, bitsadmin), encoded PowerShell (powershell -enc ...), and registry writes to autostart locations. Administrators favour .cmd for deployment scripting precisely because it runs everywhere with zero prerequisites, the same reason attackers wrap payloads in it. If a 'crack', 'activator' or emailed 'invoice' arrives as a .cmd file, that alone is the verdict.

How to open a .cmd file

Windows

  • cmd.exe (double-click runs it)
  • Notepad (Edit to read first)

macOS

  • any text editor

Linux

  • any text editor

Is a .cmd file dangerous?

Yes: identical risk profile to .bat: it's runnable script text. Read before running.

Related file types

.bat.ps1.vbs

Not sure what a file is? Check its bytes.

File names lie; magic numbers don't. Drop any file into the identifier: nothing is uploaded.

Identify a file →