A BAT file is a script containing commands, written in plain text with a .bat extension. Batch files are versatile, executing built-in Windows commands or programs with command-line interfaces. Batch files are run by double-clicking them, and can be edited with any plain text editor.