All about BAT Files

The BAT file type is primarily associated with cmd.exe.

BATFile Extension BAT
File extension: BAT
File type:  text-based script executed by a command interpreter

What is a BAT file?

BAT files mostly belong to cmd.exe. BAT files are Windows batch scripts that store a series of command-line instructions in a plain text file. When run, these commands are processed by cmd.exe (the Windows Command Processor) to execute tasks in sequence.
Main details:
  • They contain commands that run automatically without further user input.
  • You can open and view them with any text editor, such as Notepad.
  • They are used to automate routines, set up environments, or run maintenance jobs.
  • Most are saved in a standard text format, though some may be encoded as UTF-16 (LE), affecting how they display in certain editors.
  • The files may include control commands and error-checking mechanisms (e.g. use of %ERRORLEVEL%).
  • FilExt.com note: More technical details, including command references, can be found on the Microsoft documentation.

    How can I open a BAT file?

    You need a suitable software like cmd.exe to open a BAT file. Without proper software you will receive a Windows message "How do you want to open this file?" or "Windows cannot open this file" or a similar Mac/iPhone/Android alert. If you cannot open your BAT file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a BAT file directly in the browser:. Just drag the file onto this browser window and drop it.

    Online BAT Text Viewer

    Choose your .bat file to view

    Read our privacy guarantee in Filext’s terms and privacy policy

    Please allow ads on our site

    This helps us keep our servers running. Then re-upload your file to view it.

    Click here to see how to disable the ad blocker for filext.com

    How to extract texts from BAT files or capture a screenshot to PDF, JPG, DOCX, TXT, ...

    If you want to extract texts from BAT file or capture a screenshot, you can use our free Online BAT File Viewer:
    1. To do so, click the "Choose your .bat file to view" button above.
    2. After your file is opened in browser,
    3. click "Save as..." in the menu.
    4. Then choose the file format (e.g. JPG, PDF, DOCX, TXT, ...) you want.
    5. Download the converted file.

    Programs that open and convert BAT files:

    1. cmd.exe
      See the previous paragraphs to learn more about the main application. BAT files are often referred to as cmd.exe executables because this type of file is primarily created or used by this software.
    2. Batch Processing by Microsoft Corporation
      DOS batch file. A batch file is an ASCII file of commands that run as a program would run. If your BAT file extension association has been disabled, see the Associated Links for a possible fix. Note: This file type can become infected and should be carefully scanned if someone sends you a file with this extension. The Mime types used with this association are: application/bat, application/x-bat, application/x-msdos-program, application/textedit, application/octet-stream. Program ID is batfile Related links: XP File Association Fixes

    BAT file format:

    If you can determine the file format, the associated program can also be determined. The file format can be deduced from the file extension and the signature. However, different programs can use the same file extension. Furthermore, a file extension can be renamed incorrectly and double-clicking on it will then display an error when it is opened. When there is a problem with a file, the first step to solving it is to determine the file format. Below you will find our evaluation of the BAT files:

    The BAT extension is very commonly used. This BAT file itself is among the most popular common file types and includes different formats for different programs. The file formats most commonly found in BAT files are:

    All other BAT files (55%) have no uniform format, the following 18 formats can be found: EXE, Echo, start, set and java. These files sometimes refer to filetype, filext, batch, windows, backup, clean or patch. You can get all the details of your BAT file by dragging it onto this page or by clicking the button "Choose your .bat file to view" above.

    Technical Data for BAT File Extension

    File classification:
    Executable
    Program ID:
    batfile
    Related files:
    Mime type:
    application/bat, application/x-bat, application/x-msdos-program, application/textedit, application/octet-stream

    The following listing is compiled from the database produced by the 'Associate This!' program, selected data from the main FILExt database and file extension information submitted by users.

    ProgramID: batfile, FileType: MS-DOS Batch File, AppName: %1
    EXEFile: %1

    ProgramID: batfile, FileType: MS-DOS Batch File, AppName: Notepad
    EXEFile: NOTEPAD.EXE

    ProgramID: batfile, FileType: MS-DOS Batch File, AppName: WinBat
    EXEFile: WinBat.exe

    ProgramID: UltraEdit.bat, FileType: MS-DOS Batch File, AppName: UltraEdit-32 Professional Text/Hex Editor

    ProgramID: batfile
    EXEFile: %1 %*

    ProgramID: UltraEdit.bat
    EXEFile: Y:\UltraEdit\uedit32.exe %1

    ProgramID: batfile
    EXEFile: %ProgramFiles%\@Home veiligheid\AntiVirus\AVFileMon.exe %1 %*

    ProgramID: TextPad.bat
    EXEFile: %1 %*

    ProgramID: PFE32
    EXEFile: notepad.exe


    a bat text-based script executed by a command interpreter is a special file format and should only be edited and saved with the appropriate software.

    How to solve problems with BAT files

    • Associate the BAT file extension with the correct application.
    • Update your software that should actually open text-based script executed by a command interpreters. Because only the current version supports the latest BAT file format. Search, therefore, e.g. on the manufacturer website after an available cmd.exe update.
    • To make sure that your BAT file is not corrupted or virus-infected, get the file again and scan it with Google's virustotal.com.
    • Click here to open your .BAT file online - secure, fast, and no downloads needed.
    Drop here
    View another file
    BAT file viewer BAT file description