.bat
High riskWindows Batch Script
A Windows batch script run by the Command Prompt. Double-clicking executes the commands inside — and therefore can do anything a user can.
MIME types
- application/x-bat
- application/bat
- text/plain
Category
executable
Aliases
.cmd
What opens this file
- Command Prompt
- PowerShell
- VS Code (editing)
How to open by OS
Windows
- Double-click to run, or invoke from CMD.
Mac
- Not directly; possible via Wine.
Linux
- Not directly runnable.
Ios
- Cannot run.
Android
- Cannot run.
Safety notes
- A .bat in an attachment or extracted ZIP can chain into PowerShell or WSH to download and execute malware faster than most AVs react.
Common mistakes
- Skipping
@echo offat the top floods the console with every command — breaks readability for automation scripts. - UTF-8 encoded files can mangle non-ASCII characters. Use Shift_JIS (for Japanese) or prepend
chcp 65001.