Bat or it is also known as a batch is a kind of how to execute the application or it is a system with the basis of command that is used in the Windows operation system. Batch has the execute structure, algorithm and also almost the same code writing with Bash where it is one of the programming languages in Linux or Mac Os.
Basically, the .bat or batch is the simplest way that you can do to automate the tasks in your Windows. You can simply use the Notepad editor that is combined with the Windows command and change it into the batch file. In addition, the other definition of a batch is a kind of script file in the OS/2, DOS, and Windows. This file consists of the command series to be executed by the command line interpreted and then will be stored in the plain text file.
Below, we will share some instructions on how to create a .bat file in Windows 10. So, check this out.
How to create the .bat File to Open the Applications on Windows
You have to note that this method can be used on all versions of the Windows. Here are the steps by steps to do it:
- (optional) First of all, please ensure that the application that you will run has been registered in the PATH Windows. To check on it you can open the setting menu of environment variables that are located in the Control panel > security and system > system > advance system settings > environment variables.
- (optional) If you want to register an application on Path Windows, you can choose the option of Path (in the variable column) and then click the edit button in the environment setting.
- Later, a new page will be displayed. In that page, you can see the group of directory locations that can be accessed through the CMD or Run in Windows. To register the application that you want, click the new button and then enter the address of the application directory that you want to get and then press the OK button.
- Prepare the text editor (Notepad, sublime and many more again) which is later used as a typing media of Batch command.
- Enter the command to that text editor (you can get the command information on the internet)
- Save the command file that was entered before. Please ensure that the file is using the .bat extension in its storage.
- To ensure that the Batch is successfully run, click the Batch file that you have made before. Usually, there will be a CMD that contains the command groups that you have already made. Together with that CMD, the application that we want to run will be displayed as well.
That is the method in order to answer the question of how to create a .bat file in Windows 10. If that first method is not working for you, maybe the other methods below are suitable.
The Other Solution create the .bat File Withe notepad app
Well, we are still having this second method to make you are easier to create the .bat file in Windows 10 or in the other Windows type such as the Windows 8.1, Windows 7 or even the Windows XP. So, check out the steps below.
- First of all, you have to open a new notepad file. In addition, you can also use the similar text file editor such as the Notepad ++
- After that, you need to type this command.
Title My test Batch File
::see the title at the top. And this comment will not appear in the command prompt
Echo test file executed
Echo I am too lazy to write command again
- After that, save the text file with the .bat extension instead of using the .txt type. You have to note and ensure that the hide file extensions feature is already turned off in the Windows. Furthermore, you will not able to changing the file extension. For checking this you can go to the control panel and then choose the file explorer options > View Tab > uncheck the hide extensions for known file types.
- For running the batch file, you can just double-click on it. After that, the CMD Windows will be opened automatically with some desired outputs.
Well, those are the instructions to do the second method of how to create a .bat file in Windows 10. This method is working really well for most of the users, so maybe it is also the perfect method for you.
The Other Information about the Batch File
We also want to share some information about this Batch file that is maybe beneficial for you. Here is some of that information.
– How to run the batch file on your Windows 10?
To do so, you can execute the bat file from within the CMD Windows. For opening the file by using cmd, you need to navigate the directory or the folder where the file is stored or located. After that, please type the name of that file along with the file extension. For the example is if you need to run a bat file with the name of HelloAngel. You can type the HelloAngel.bat and then press the enter button.
– How to modify or edit the Batch File
Maybe some of you want to do the experimentation with the batch files that you have created in the past. Basically, editing the bat file is so simple. The process is not difficult. To do so, you just need to do the right-click the file and then choose the rename option. After that, it will open in the text editor.
If you have done, you can save the changes and it is good to go. In the future when you run the bat file in the command line, then it will execute all the changes that you have created.