If you are a Windows user, you have most likely used hundreds of executable files, or exe. But sometimes some executable programs use lesser known extensions and we have to convert them. Today we show you how to change the extension of a batch file to .Exe.
What is a batch file?
Before modern operating systems existed, where we use programs and applications with beautiful and easy-to-use user interfaces, computers were used by entering commands directly on a black screen.
Although today most of what we do on a computer we do it through a graphical interface, there are still many situations in which we need Windows to interpret commands directly. That is why there is the cmd.exe, called Command Prompt .
The command prompt is a black screen with a simple text box where we can enter commands for Windows to run. The most basic commands such as ping or ipconfig can be entered manually, but if we need to enter several commands one after the other, or we need to use more complicated commands, we need a more complex solution.
That is why batch files exist. A batch file is a text file that contains a series of commands. When we run this file, the command prompt executes all the commands in this file in order.
What is an exe file?
An executable file can do a variety of things. Most of the time, when we use an executable, we want to install an application. When you double click, the installer creates a folder with all the files the application needs, and another exe file that starts it. But executables can also contain an entire application. There are portable programs that can run just with the exe file.
Every application you have installed on your Windows computer probably has a main exe file. When you click on the shortcut to the application, that executable opens and the application starts.
Now, to know how to convert a batch file to exe, it is important to know what is inside an exe. We know that a batch file contains lines of code, but an exe is very different.
Inside an exe there are several types of data, from code that can be read by the computer, to XML files, data, folders that must be copied, internet accesses, and compressed data, among other things.
How to change the extension of a batch file to .exe?
You can run a batch file by double clicking, so you can usually use them without converting them to any other extension. However, there are situations in which you may prefer an .exe file, so we are going to show you how to convert it.
Using Windows tools
Since batch files are simply plain text commands, there is no real way to turn them into an executable. However, it is possible to create an executable that does the same as a given batch file.
On Stackoverflow, a user created code that allows you to do just that. You just have to enter the site, copy the code, paste it in the notepad, and save the file with the name “Converter.bat”. Then, you take the batch file you want to convert and drag it on top of the converter.
The code uses a tool that comes bundled with Windows called “IExpress” to compile the batch file and create a new .exe file
Using external tools
As with any conversion between extensions, there are a multitude of programs and services that allow you to easily convert from batch to exe. At Miracomosehace.com we don’t recommend any in particular, but a simple Google search will allow you to find the most popular ones.
Change the icon
When you convert a batch file to exe, the resulting file has a generic Windows icon. To change the icon of an EXE file you must download a program like resource hacker, or create a shortcut to the exe file and change the icon using the properties menu.
It is important for all good users to know the basics of the files they use on a day-to-day basis. Therefore, we invite you to continue learning about batch files and the windows commands that you can use with them.