In this guide I will explain what a BAT file is, how you can create it in Windows 11 and what things will help you have one. At the moment, I advance that, if you are looking for the way run batch commandswhat I tell you here is very interested. Discover all the ins and outs of one of the most unknown files in the world Windows and learn everything possible with a Bat file.

What is a BAT file?

A BAT file is a flat text file that allows the user execute several CMD commands at once. His name comes from Batchin Spanish, batch. The term Batch is usually used in computer science with the idea of ​​completing several tasks with a single request. For example, in Windows, if you select several files and renowned, they are all called the same, although each one has a number to generate a series. The user is only making a request, namely, rename a file. However, the operating system understands that the same action must apply to all selected files, executing the same lot in lot.

In the network it is easy to find all kinds of “Batch” programs, in charge of completing many lots in lot. Without going any further, you have Bulk Renamer Utilitythat changes the name of many files at the same time (as Windows does, by the way). It also exists Image Resizerof Powertoys, who is able to change the size of many images at the same time. I put all these examples to make the concept clear.

Returning to the Bat file, it is a very old type of file, present from the most original versions of Windows. In fact, I used them in the time of Windows 95. He has not rained since then! As I told you, its usefulness is to execute one after another a list of commands of the CMD. This helps you save a lot of time, especially when you have to repeat certain tasks repeatedly through the command line.

Use cases for the BAT file

Here are some practical cases in which a BAT file is very useful:

  • Create file backup copies. You can configure a command that copy the content of a folder into another. Just by clicking, the CMD would be in charge of executing this and other associated tasks, such as the deletion of the original folder.
  • File management. Within a BAT file, several commands can be included to decompress a source file of your PC, copy the resulting files in a fate of destination and erase the original file.
  • Team performance improvement. Using several commands, such as SFC, Chkdsk or DIM, all of them executed by lots, it is possible to recover some damaged files and diagnose problems on the hard drive.
  • Execute any application command. I use a BAT file to run RCLONE and create a daily backup of Google Drive. In addition, I have created the file inside the starting folder so that the commands are executed when the computer starts. Here you have a guide where I explain how to make a program start with your computer.

How to create a Bat by step file

Generally, advanced users are the ones who take the most out of the CMD commands. This has caused the popularity of the BAT file to be less and less. However, you may be interested in generating yours to launch several batches. How can you do it? It is very simple.

The first thing is Generate a new text file. Use the option you have in the Windows context menu.

Then change the name of the file using the denomination you prefer. It is also important that you change the extension of TXT to bat. If the extension does not appear, take a look at the guide on how to see the file extensions in Windows.

How to create a Bat by step file: uses and functions

Confirm the extent change by pressing Yeah In the emerging window.

How to create a Bat by step file: uses and functions

Then, right click on the BAT file (which should have already changed icon) and select the option Edit.

How to create a Bat by step file: uses and functions

Using the notes, enter the commands you want to run. In this example, I am creating a file to close Microsoft Edge. When this has happened, the CMD will return a message and will be expected to press a key to continue. For the latter I have used the command Pause.

How to create a Bat by step file: uses and functions

Finally, save the changes in the BAT file. Now you just have to double click to try it.

How to create a Bat by step file: uses and functions

As shown in the superior image, the CMD first executes the command that ends the Edge processes, then sends me the message established with the command echo And finally, he pauses waiting for a key to press. If there were more commands after the pause, the console would begin to execute them. As is not the case, when touching a key, the CMD closes.

And you, what is useful to the Bat file? Leave me your comment below. I read you in the comments!

Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *