Home » Guides » How to Create a .Bat File

How to Make a .Bat File

Here's a step-by-step guide on how to make and run a .bat file on Windows. Check this simple guide to create batch files in Windows.

On Windows PC, a batch file is a text file that contains at least one MS-DOS command. The Windows system will identify a batch file by the extension “.bat” and run the commands in the file other than opening the file in Notepad. You can easily create a bat file in Windows you have your PC perform one or more MS-DOS commands automatically when you double click the same file. In this guide, I will show you how to make a .bat file on a Windows computer.

How to Make a .Bat File on Windows PC

make a batch file

Basically, a batch file or .bat file is a file that contains command-line code that can be executed on Windows operating system as per the registered source code. In any case, this batch file is supposed to be used to start using programs and run utilities.

Then, how to make a batch file (BAT) in Windows? In this article, I will explain how to create a batch file (.bat) in Windows, here are the methods:

  • First of all, click on Start and then type Notepad in Search.
  • Click the Notepad icon when it appears on the search results list.
  • After that type the commands that you want Windows to run when you double-click the batch file. You also have to place each order on a separate line. For instance, if you want the batch file to change the directory to “C:\Games” and run the program “game.exe”, the first line of the file should contain the “cd c:\games” command, and the second line should contain the command “game.exe”.
  • After that click on the File menu at the top of the Notepad window and select Save As.
  • Now you need to click on the drop-down menu next to Save as type and then choose All Files.
  • You can type the desired file name in the File name field, and include the “.bat” extension. For example, “game.bat” is a valid filename for a batch file.
  • Finally, click on the Save button.

And that is how you have now created a .bat file on a Windows computer. Also, do not forget to check how to fix inaccessible boot device error, and how to boot from a USB drive on Windows 10.