How to change the icon of compiled script namedly .exe file (not tray icon)?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Sabestian Caine
Posts: 528
Joined: 12 Apr 2015, 03:53

How to change the icon of compiled script namedly .exe file (not tray icon)?

Post by Sabestian Caine » 18 Jun 2019, 13:36

I want to change the icon of compiled script permanently. Most of the stuff is available about changing the tray icon, but i want to change the icon of .exe file as shown below-
19_06_19 @12_01_21.PNG
19_06_19 @12_01_21.PNG (4.38 KiB) Viewed 4585 times

I want to change the above icon permanently.



I tried to follow the steps as told in documentation here-
https://www.autohotkey.com/docs/Scripts.htm#ahk2exe


But, I am not understanding what exactly to do?

Please help and guide..

Thanks a lot...
I don't normally code as I don't code normally.
RickC
Posts: 302
Joined: 27 Oct 2013, 08:32

Re: How to change the icon of compiled script namedly .exe file (not tray icon)?

Post by RickC » 18 Jun 2019, 16:56

I use Compile_AHK II - for those who compile! [v0.9.2 (04/19/16)] (https://www.autohotkey.com/boards/viewtopic.php?t=16061).

Hope this helps...
Dicerca
Posts: 1
Joined: 07 Sep 2017, 23:20

Re: How to change the icon of compiled script namedly .exe file (not tray icon)?

Post by Dicerca » 18 Jun 2019, 20:32

I use a program called Resource Hacker to change the icon of my AHK scripts. https www.howtogeek.com /75983/stupid-geek-tricks-how-to-modify-the-icon-of-an-.exe-file/ Broken Link for safety
TAC109
Posts: 1129
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: How to change the icon of compiled script namedly .exe file (not tray icon)?

Post by TAC109 » 18 Jun 2019, 21:02

You can use the new enhanced beta version of Ahk2Exe which allows Compiler Directives, including setting the .exe icon.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
mauritius
Posts: 25
Joined: 06 Nov 2020, 14:00
Contact:

Re: How to change the icon of compiled script namedly .exe file (not tray icon)?

Post by mauritius » 08 May 2023, 09:45

If you change the name of the .exe and the icon changes then you need to clean windows' icon cache. I did accordingly as here were explainded and it helped: https://superuser.com/questions/499078/refresh-icon-cache-without-rebooting
TAC109
Posts: 1129
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: How to change the icon of compiled script namedly .exe file (not tray icon)?

Post by TAC109 » 08 May 2023, 16:45

@mauritius You can also select 'File' => 'Refresh Windows Icons' in the Ahk2Exe gui.

Edit: Fixed menu path.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Post Reply

Return to “Ask for Help (v1)”