BAT - DOS Batch Files are used to run commands or simple programs from the Windows command prompt or in DOS. Bat files are easily opened or written using any text editor such as NotePad, and they can be written manually quite easily if you understand command language. Bat files are useful for automating repetitive tasks or for setting up applications. Before running an unfamiliar batch file, you may want to examine it using a text editor first to find out what it does, since some malware uses bat files to infect PCs. Bat files are only used on Windows PCs or on Macs or other hardware that is running in Windows emulation mode.