Online Batch File Editor – Create a BAT File
Create a BAT file or edit Windows batch scripts in your browser. Use syntax highlighting and find tools, then copy your code or download a .bat file. Scripts are not run in the browser.
Basic word suggestions appear as you type; press Ctrl+Space to open the list. Find: Ctrl+F (Cmd+F on Mac). This page edits and downloads scripts—it does not run Windows batch commands.
Copy or download your script before leaving. Drafts are not automatically saved.
Choose editor font size in pixels
Use this editor for short Windows automation scripts, classroom exercises and reviewing existing batch code. It is useful for students, IT support staff and developers who need to draft or share a small script without opening a full development environment.
For debugging or larger automation projects, use a local editor and test in the Windows environment where the script will run.
- Type a new script or paste an existing batch file into the editor.
- Edit the commands using syntax highlighting and find tools.
- Adjust the theme, font size or word wrap for readability.
- Enter a filename such as
hello.batto create a BAT file download. - Select Download, or use Copy to copy the script. This page does not run the script.
Copy or download your script before leaving. Drafts are not automatically saved.
These examples use Windows Command Prompt syntax. Copy one into the editor, then download a .bat file to test on Windows.
Display a message
@echo off
setlocal
set "name=World"
echo Hello, %name%!
endlocalList text files in the current folder
@echo off
rem Display filenames without modifying files.
for %%F in (*.txt) do echo %%~nxFCheck whether a file exists
@echo off
if exist "example.txt" (
echo example.txt was found.
) else (
echo example.txt was not found.
)- Comments: use
remfor explanatory lines. - Variables: assign with
set "name=value"and read with%name%. - Loops: use
%%Fin a batch file; interactive Command Prompt uses%F. - Conditions: use
ifwith batch commands and parentheses where needed. - Paths: quote paths containing spaces.
- Batch files use Windows Command Prompt syntax. PowerShell and Bash scripts use different syntax.
Official command reference: Microsoft Windows Commands.
Download the script with a .bat extension and test it in Windows Command Prompt. Review the commands before running them, especially commands that change or delete files.
The browser editor cannot confirm whether paths exist, permissions are sufficient or commands will succeed on your Windows machine. Syntax highlighting is not validation.
- Can I run batch files in this editor?
- No. This page edits and downloads scripts. It does not execute Windows commands in your browser or on ConversionTab servers. Run your downloaded script in Windows Command Prompt.
- How do I create a BAT file?
- Type or paste your script, enter a filename such as hello.bat, then select Download. If you enter a name without an extension, the editor adds .bat.
- Can I save a CMD file?
- Yes. Enter a filename ending in .cmd before downloading. The editor preserves that extension.
- Can I edit an existing batch script?
- Yes. Open the file in a text editor, copy its contents and paste them here. Edit the script, then download the revised file.
- Does syntax highlighting check whether my script works?
- No. Highlighting helps you read commands and variables. It does not execute the script or validate its behavior on Windows.
- Is my script automatically saved?
- No. Copy or download your work before reloading or leaving the page. Editor preferences may persist on this device, but the script is not automatically saved.
- Can I edit on macOS or Linux?
- Yes, you can edit and download the text in a supported browser. Windows batch commands normally need a Windows Command Prompt environment to run.
- Does this editor support live collaboration?
- No. It does not provide shared editing sessions or cloud projects. You can share a downloaded script yourself.