At One Place

.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

Sources

  1. Media Types Registry — IANA
  2. Official vendor product documentation — At One Place

How these figures are compiled and checked