jbm Posted December 19, 2004 Share 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. Link to comment Share on other sites More sharing options...
gunsmokingman Posted December 19, 2004 Share Posted December 19, 2004 (edited) double post my mistakeRemoved By GSM Edited February 22, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
gunsmokingman Posted December 19, 2004 Share 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 Link to comment Share on other sites More sharing options...
jbm Posted December 19, 2004 Author Share 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. Link to comment Share on other sites More sharing options...
sonica Posted December 19, 2004 Share 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? Link to comment Share on other sites More sharing options...
jbm Posted December 19, 2004 Author Share 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. Link to comment Share on other sites More sharing options...
gunsmokingman Posted December 19, 2004 Share 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 Link to comment Share on other sites More sharing options...
Incroyable HULK Posted December 19, 2004 Share Posted December 19, 2004 I think you can do it with AutoIT... you just have to specify the icon you want for your package. Link to comment Share on other sites More sharing options...
jbm Posted December 19, 2004 Author Share 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. Link to comment Share on other sites More sharing options...
nakira Posted December 19, 2004 Share 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 Link to comment Share on other sites More sharing options...
Tsunami Posted December 19, 2004 Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now