Friday, July 19, 2019

cmd.exe - Change icons of specific cmd windows in Windows 10



I typically have multiple cmd windows open for different purposes. To keep them straight, I set the background colors, the titles, and the window icons. I recently upgraded from Windows 7 to Windows 10, and everything still works except for the customization of the icons.



I created shortcuts for the various cmd windows, and set custom icons in the shortcut. In Windows 7, the cmd windows would inherit the icon of the shortcut used to launch it, but in Windows 10, cmd windows launched from a shortcut always show the generic application icon (not even the regular cmd icon).




Is there a way to get the old Windows 7 behavior in Windows 10?


Answer



What should be retained from this answer and the comments below, is that
after my remark that there is no problem in setting the icons of
CMD shortcuts when using icons from C:\Windows\System32\shell32.dll,
the poster has moved his icons DLL to C:\Windows\System32 and suddenly
it all started working well, exactly the same as it did before in Windows 7.



Apparently there is some new obscure restriction in Windows 10, surely in the
name of security, that for CMD windows only icon sources in

C:\Windows\System32 are acceptable.






Old answer (relating to .bat files)



Windows 10 will not let one change the displayed icon for a .bat file that
is stored on the desktop. There is no explanation as to why this is so.



The solution is to store the file somewhere else, to create a desktop shortcut

to it and then to change the icon on that shortcut.



There is another weird problem in that the changed icon is not immediately
displayed, which gives the impression that the change did not work.
To fix this, type F5 while the focus is on the desktop,
and this will refresh the desktop display.



In case when the icon display is totally broken, you could try to
Rebuild a Broken Icon Cache
after setting your icons, then reboot.



No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...