WhyCrashed

.bat · text/plain

What is a .bat file?

Batch Script

About the format

A .bat file is a batch script — plain-text commands executed line by line by cmd.exe, the command interpreter whose lineage runs back to DOS. Double-clicking one runs it immediately, a console window flashing past. Batch is still everywhere because it's frictionless: no runtimes, no policies blocking it, and it can do real work — copy files, set registry values via reg.exe, chain installers, schedule tasks. That same frictionlessness makes .bat a perennial malware delivery wrapper, usually as a downloader that pulls the real payload with PowerShell or certutil. The safety rule is the same as for .reg files and shortcuts: it's text, so READ it first (right-click → Edit). Lines that download and execute things, obfuscated gibberish with %random% variable expansions, or calls to powershell -enc (base64-encoded commands) are the tells. A .cmd file is essentially the same thing with minor interpreter differences.

How to open a .bat file

Windows

  • cmd.exe (double-click runs it)
  • Notepad (right-click → Edit to READ it first)

macOS

  • any text editor (won't run natively)

Linux

  • any text editor (won't run natively)

Is a .bat file dangerous?

Yes — it's an executable script with your full permissions. Read any batch file you didn't write before running it.

Related file types

.cmd.ps1.vbs.lnk

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 →