.bat File — Windows Batch File
application/x-msdos-program
Drop any file to identify its extension and type — runs entirely in your browser
Drop a .bat file here or click to choose
Or drop any file to identify its extension
application/x-msdos-programQuick Facts
| Extension | .bat |
| Full Name | Windows Batch File |
| MIME Type | application/x-msdos-program |
| Category | Code |
| Type | Text-based (human-readable) |
| Typical Size | 100 B – 50 KB |
| First Appeared | 1981 |
What Is a .bat File?
BAT (Batch) files are script files containing sequences of commands for the Windows Command Prompt (cmd.exe). Originating from MS-DOS in the early 1980s, batch files automate command-line tasks using a simple scripting language that supports variables, conditional execution (IF/ELSE), loops (FOR), subroutines (CALL), input/output redirection, and piping between commands. Common batch commands include ECHO, SET, COPY, MOVE, DEL, MKDIR, and REM for comments. Batch files run with the .bat extension in the Windows command interpreter and are used for system administration, build processes, application launchers, and startup scripts. The AUTOEXEC.BAT file was a critical DOS-era file that configured the system at boot time. While PowerShell has largely superseded batch scripting for complex automation on Windows, BAT files remain popular for simple tasks due to their zero-dependency nature and backward compatibility across all Windows versions. Batch scripting has well-known quirks including delayed variable expansion, percentage sign escaping, and limited string manipulation. The closely related .cmd extension works identically but is processed by cmd.exe with slightly different error handling behavior.
How to Open .bat 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.