jbm Posted December 19, 2004 Posted December 19, 2004 I have a shortcut that runs a .cmd file thatruns and .exe file with some command line options.The icon shows the normal icon for .cmd files.I can right click on it and choose change iconsand browse to the .exe file and change to the iconin that .exe file. Is there any way I can do this during an unattendedsetup?I've tried using regmon, setting the include stringto different values but didn't see anything helpful.
gunsmokingman Posted December 19, 2004 Posted December 19, 2004 (edited) double post my mistakeRemoved By GSM Edited February 22, 2006 by gunsmokingman
gunsmokingman Posted December 19, 2004 Posted December 19, 2004 (edited) The only way to do it is to hack the Cmd.exe it self.I have changed the icon on this oneRemoved By GSM Edited February 22, 2006 by gunsmokingman
jbm Posted December 19, 2004 Author Posted December 19, 2004 The only way to do it is to hack the Cmd.exe it self.I have changed the icon on this one Hacked Cmd.exeThanks for the reply.So now I need to extract the icon from the exe than add it toa cmd.exe using the one of the tools on this site. Looks like its time for me to do some more searching.
sonica Posted December 19, 2004 Posted December 19, 2004 The only way to do it is to hack the Cmd.exe it self.I have changed the icon on this one Hacked Cmd.exehow did you do that?
jbm Posted December 19, 2004 Author Posted December 19, 2004 I was able to change the icon in a copy of cmd.exe to the one I wantusing resedit and an icon editor. But if I replace the original cmd.exewith that one all bat files will show that icon right? So how do I make one bat file display a different icon than others.Is this possible.
gunsmokingman Posted December 19, 2004 Posted December 19, 2004 (edited) Here Is A quick How To Change A Icon, And adding It To Any Files.Hope This Helps Edited October 26, 2005 by gunsmokingman
Incroyable HULK Posted December 19, 2004 Posted December 19, 2004 I think you can do it with AutoIT... you just have to specify the icon you want for your package.
jbm Posted December 19, 2004 Author Posted December 19, 2004 Thanks gunsmokingman and Incroyable HULKI ended up using AutoIT, when I tried to use Reshacker it said my .batfile was not a 32bit executable and wouldn't open it.P.S I bunged up my iexplorer icon and others using a programcalled reseditor I found in this forum. Don't know if itssomething I did wrong or not. But searching the registry showedabout 150 places where defaulticon points to where reseditor isinstalled. Tried a repair install but that didn't fix it.Oh well I need to really test my unattended CD.
nakira Posted December 19, 2004 Posted December 19, 2004 This vbs file will create a shortcut named MyLink in %systemdrive% pointing to %windir%\a.cmd with the icon from regedit.exe'Shortcut.vbsset WshShell = WScript.CreateObject("WScript.Shell")Path1 = WshShell.ExpandEnvironmentStrings("%systemdrive%")Path2 = chr(34) & "%windir%\a.cmd" & chr(34)set oShellLink = WshShell.CreateShortcut(Path1 & "\MyLink.lnk")oShellLink.TargetPath = Path2oShellLink.WindowStyle = 1oShellLink.IconLocation = "regedit.exe,0"oShellLink.Description = "MyLink"oShellLink.WorkingDirectory = sPathoShellLink.Save
Tsunami Posted December 19, 2004 Posted December 19, 2004 Thanks gunsmokingman and Incroyable HULKI ended up using AutoIT, when I tried to use Reshacker it said my .batfile was not a 32bit executable and wouldn't open it.P.S I bunged up my iexplorer icon and others using a programcalled reseditor I found in this forum. Don't know if itssomething I did wrong or not. But searching the registry showedabout 150 places where defaulticon points to where reseditor isinstalled. Tried a repair install but that didn't fix it.Oh well I need to really test my unattended CD.You have to open cmd.exe in ResHacker, not your .bat file. And if you just want to change the icon of the shortcut, it's not neccesary to hack cmd.exe. Nakira's method will be enough.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now