Creating a batch (.bat) file in windows

On windows a Batch file simply a text document with the file extension .bat rather than .txt.

Step 1. Create a new file

To create a batch file, simply right click and hover over New then press Text Document.

papermc download

Step 2. Set the file name to end with .bat

With the new file created, enter the name run.bat. You should get a warning confirming you want to change the name extension, press yes.

rename to run.bat

confirm rename

Step 3. Edit the Batch file

Just like a text document, you can edit the batch file in Notepad. This can be done by right clicking on the file and selecting Edit.

confirm rename

Fixing Problems

Make sure the file type is correct

Make sure the file type is a Windows Batch File file.

windows batch file ext good windows txt file ext bad

If the file type is Text Document you’ll need to enable viewing file extensions and rename the file.

Turn the .txt file into a .bat file

To do this, click the View tab on the top of your file explorer.

windows explorer view

Then make sure File name extensions is checked.

view file name ext

Now you can go ahead and rename the file so it ends with .bat.

rename to run.bat

confirm rename