We all know that it is very easy to create a shortcut and change the icon from the properties, but here we will pursue a different objective, which is to
change the icon of an exe file
, that is, directly change the icon of the executable.
The programs icon is stored within the executable itself, so changing it is usually a fairly simple task. Before starting this tutorial, I recommend you read an earlier article in which we talk about
how to edit executable file resources
, as it will help you to better understand the concepts.
How to change the icon of an executable exe file.
The truth is that I cannot think of a practical situation in which we need to change the icon of an exe file. The only situation that comes to my mind is to try to simulate another application using the same icon.
Anyway, this tutorial is interesting to better understand the operation of executable files. We are going to need a program that we already talked about on occasion, it is about
Resource Hacker
.
To implement this tutorial, we will need an executable to change the icon, I will do it as an example with a copy of the Windows Notepad executable
notepad.exe
. The executable file is found in the path
C:\Windows\System32\notepad.exe
and we copy it to the desktop to do our tests.
We will also need an icon, we can get it on any of the pages that we recommend in the article from
where to download icons
.
We already have everything we need, now we run Resource Hacker and open the
notepad.exe
file through the
File → Open
menu.
Next, we double-click on
"Icon group"
and see that the resource named
"2: 1033"
is displayed, which contains the program icons in their different sizes. We right-click on the resource and select the
"Replace Icon ..."
option.
A new window will open where we press the
"Open file with new icon ..." button
and select the new icon. We only have to press the
«Replace»
button and save the changes through the
File → Save
menu.
We see that with a little practice, changing the icon of an exe file is a task that does not take even five minutes.
This shows how easy it would be to deceive an inexperienced user and the importance of using a good antivirus.