Home > Blockchain >  How do i change the icon of a folder in windows?
How do i change the icon of a folder in windows?

Time:06-23

I'm trying to change the icon of a folder windows with a custom icon for my program. I know I can by right clicking folder and using properties to change the icon, but I need the icon to be permanently different for part of my software I'm making. This is a NWJS app.

EDIT of what I've done:

desktop.ini

[.ShellClassInfo]
ConfirmFileOp=0
NoSharing=0
IconFile=Folder.ico
IconIndex=1
InfoTip=Secure Drive

Path: "D:\SECURE DRIVE"

I used attrib s "SECURE DRIVE" after using CD'ing to D:\. I've restarted and refreshed folders and the icon is still not changing. The icon is an ICO I converted using an online converter in 32bit with all available sizes. The icon is named Folder.ico located in the same DIR as the desktop.ini.

CodePudding user response:

This is done through creating a Desktop.ini file. See here for MSDN Documentation: https://docs.microsoft.com/en-us/windows/win32/shell/how-to-customize-folders-with-desktop-ini

EDIT1:

To quote from the link above:

Use the following procedure to customize a folder's style with Desktop.ini:

  • Use PathMakeSystemFolder to make the folder a system folder. This sets the read-only bit on the folder to indicate that the special behavior reserved for Desktop.ini should be enabled. You can also make a folder a system folder from the command line by using attrib s FolderName.
  • Create a Desktop.ini file for the folder. You should mark it as hidden and system to ensure that it is hidden from normal users.
  • Make sure the Desktop.ini file that you create is in the Unicode format. This is necessary to store the localized strings that can be displayed to users.

CodePudding user response:

IconIndex=1 must be IconIndex=0 for .ico files.

  • Related