<< Click to Display Table of Contents >> Navigation: 3. Script Language > RES. - EXE-Resourcen managen > Resourcen-Commands |
MiniRobotLanguage (MRL)
RES.Change Icon
Change the Icons of an executable or DLL-File
Intention
This command is used to change the Icon of an Executable or DLL-File.
As Source Icon, you can specify whether an ".ico"-File, or you can specify another Executable or DLL.
In this case the program will first extract the icon and then use it for the Executable.
Lets make an Example. We have an Folder like this:
Here is our Script.
Now we run the Script. The folder will just change a bit and look like this.
For technical reasons the Icon seems unchanged.
Don't worry the Icon was changed, the Explorer just did not realize it yet, due to cache-effects.
You may also notice that the was made an Backup of the Target-File named "File.exe.Bak".
This is because we specified the "1" as third Parameter.
It is recommended to always work on a copy of the file.
Doing it this way, you always have a working copy of the Target-File as Backup.
Now we use the "Properties" to see which Icon is really in there.
And you see, that the Icon has been "implanted".
Important Note: You must specify an valid ".ico"-File as Source-Parameter.
You can not specify an EXE-File or an DLL-File, even if this one may contain an Icon.
If you specify any other filetype the result is unpredictable.
In our tests, most often the target file will just not have any Icon after the operation.
Syntax
RES.Change Icon|P1|P2[|P3]
RES.CI|P1|P2[|P3]
Parameter Explanation
P1 - Path of EXE-File or DLL-File
P2 - Path of Icon-File
P3 - (num) 0/1/2/3 - Flag (default is 0)
0 - no Backup, Refresh Explorer
1 - make Backup before changing file, Refresh Explorer
2 - do not "Refresh Explorer" do not make a Backup
3 - do not "Refresh Explorer", but make a Backup
Example
'**********************************************
' Path to the Icon File
VAR.$$SRC=?path\Bug.ico
' Path to the File that will get this Icon.
VAR.$$TAR=?path\File.exe
RES.Change Icon|$$TAR|$$SRC|1
ENR.
Remarks
Please take care of these points.
1. Files may be protected or copyrighted
2. Signed files may loose their signature (but you may sign them yourself after the process)
3. If the process fails for whatever reason (Antivirus .. etc.) the result may be an unusable file!
Especially for this reason, always work on a copy of the original file!
Limitations:
-
See also:
• 2.2.1 '#ICO: - Choose own Icon
• 2.2.2 '#ICF: - Icon from Icon-Folder
• 2.2.3 '#ICS: / '#ICS: Icon-Set