also, these:
If (WriteValue($NewIconKey,"exec",$NewIconValue,"REG_SZ") <> 0)
EndIf

are just the same as:
$nul=WriteValue($NewIconKey,"exec",$NewIconValue,"REG_SZ")

just not solving the problem with this but the script is a lot shorter without the unneeded stuff.
_________________________
!

download KiXnet