.bat files
.bat file
Windows Batch File
A plain-text list of Command Prompt commands that runs when you double-click it.
What opens a .bat file
- Windows
- Command Prompt (built in — double-click runs it), Notepad (built in — to read it first), Visual Studio Code
- macOS
- Any text editor (to read — will not run)
- Linux
- Any text editor (to read), Wine (to run)
What a .bat file is
A .bat file is a script for the Windows command interpreter, dating back to DOS. It is readable text, so always open a downloaded one in Notepad and read it before running — double-clicking executes every line immediately with your privileges. Right-click and choose Edit to inspect; the newer .cmd extension behaves almost identically.
Converting it
A .bat file is commonly converted to .cmd, .ps1, .exe or .txt. It is a plain text format, so any text editor can open and edit it directly.
Details
- Extension
- .bat
- Full name
- Windows Batch File
- Category
- Programs and installers
- Created by
- Microsoft
- Format
- Plain text
Common questions
- How do I open a .bat file?
- On Windows use Command Prompt (built in — double-click runs it); on macOS use Any text editor (to read — will not run); on Linux use Any text editor (to read). A plain-text list of Command Prompt commands that runs when you double-click it.
- What is a .bat file?
- Windows Batch File. A .bat file is a script for the Windows command interpreter, dating back to DOS. It is readable text, so always open a downloaded one in Notepad and read it before running — double-clicking executes every line immediately with your privileges.
- Can I convert a .bat file?
- Yes. It is usually converted to .cmd, .ps1, .exe or .txt, either by exporting from one of the programs listed above or with a format converter.
Related pages
- .exe — Windows Executable A Windows program. It runs code, which is why it is also the classic way to get
- .apk — Android Application Package An Android app installer — a zip of code and resources.
- .msi — Windows Installer Package A structured Windows installer that the OS installs and can cleanly uninstall.
- .dll — Dynamic Link Library Shared Windows code that programs load — not something you open or run.
- .sh — Shell Script A text file of Unix shell commands, run by bash, zsh or sh.
- .deb — Debian Software Package The installer format for Debian, Ubuntu and their derivatives.
- .jar — Java Archive A zip of compiled Java classes — a library, or a runnable program.
- .pkg — macOS Installer Package A macOS installer that runs a guided setup, rather than a drag-and-drop app.
- .ps1 — PowerShell Script A script for Windows PowerShell — Microsoft's modern automation shell.
- .ipa — iOS Application Archive An iPhone or iPad app package — installable only through Apple-sanctioned channe
- .rpm — RPM Package The installer format for Fedora, Red Hat, openSUSE and their relatives.
- .appimage — AppImage Portable Application A whole Linux application in one file that runs without being installed.
Sources
- Media Types Registry — IANA
- Official vendor product documentation — At One Place