How to change the icon of .bat file programmatically?

前端 未结 10 628
予麋鹿
予麋鹿 2021-02-05 00:45

I\'d like to know what\'s the way to actually set the icon of a .bat file to an arbitrary icon. How would I go about doing that programmatically, independently of t

10条回答
  •  粉色の甜心
    2021-02-05 01:16

    The icon displayed by the Shell (Explorer) for batch files is determined by the registry key

    HKCR\batfile\DefaultIcon
    

    which, on my computer is

    %SystemRoot%\System32\imageres.dll,-68
    

    You can set this to any icon you like.

    This will however change the icons of all batch files (unless they have the extension .cmd).

提交回复
热议问题