如何更改Windows中文件夹的图标?

发布于 2025-02-09 07:32:58 字数 517 浏览 1 评论 0 原文

我正在尝试使用程序的自定义图标更改文件夹窗口的图标。我知道我可以通过右键单击文件夹并使用属性来更改图标,但是我需要图标在我制作的部分软件中永久不同。这是一个NWJS应用程序。

编辑我所做的工作:

desktop.ini

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

路径:“ d:\ secure drive”

我使用 attrib +s“ Secure Drive” 使用 CD'到D:\ 之后。我已经重新启动和刷新了文件夹,图标仍未更改。该图标是我使用32位以所有可用尺寸的在线转换器转换的ICO。该图标命名为 folder.ico ,位于与 desktop.ini 的同一DIR中。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执笔绘流年 2025-02-16 07:32:58

This is done through creating a Desktop.ini file. See here for MSDN Documentation: https://learn.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.
暮年慕年 2025-02-16 07:32:58

iconIndex = 1 必须是 iconindex = 0

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文