![]() ![]() bat file followed by this: Changing desktop.ini doesn't update folder icon automatically in Windows but my folder still shows the previous icon. "Use a shell function that will notify all running Explorer windows to use the updated desktop.ini" using VBScript (Did not work for me) SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_NOTIFYRECURSIVE, "path/to/folder/desktop.ini", NULL) SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH, folderPath, NULL) #include Ĭonst char folderPath = "path/to/folder" I tested this on two computers (both Windows 10). I tried running this C code (after compiling using npm command g -o refresh-folder-icons refresh-folder-icons.cpp) and it worked! but I the changes take place between 1 to 5 minutes and if you're lucky, then you see it instantly. Inspired by: How to refresh the folder icon instantly in Windows SHChangeNotify() (works, but not immidiately) If (MoveFile(_T("C:\\Users\\elron\\Elron Apps C\\005 Folder Icon\\paste-folder-icon\\desktop-temp.ini"), _T("desktop.ini"))) SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_NOTIFYRECURSIVE, folderpath, NULL) SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_NOTIFYRECURSIVE, NULL, NULL) If (MoveFile(_T("C:\\Users\\elron\\Elron Apps C\\005 Folder Icon\\paste-folder-icon\\desktop.ini"), _T("desktop-temp.ini"))) rename("C:\\Users\\elron\\Elron Apps C\\005 Folder Icon\\paste-folder-icon\\desktop.ini", "desktop-temp.ini") #include Ĭonst char folderpath = "C:\\Users\\elron\\Elron Apps C\\005 Folder Icon\\paste-folder-icon" That led me to a hope that I can do the same programmatically, so I tried this C code, that changes desktop.ini to desktop-temp.ini and back to desktop.ini, also with notifying windows that a change has occurred, but it did not work unfortunately. (changing desktop.ini to uppercase/lowercase or to desktop-temp.ini and then back to desktop.ini) When doing so, I see the folder icon change immediately. I found a way to see the icon change immediately, but it worked only when manually renaming desktop.ini through the explorer itself. Hopes / unfulfilling attempts Renaming desktop.ini programmatically (Not working unfortunately) It would be better if it would not clear the entire thumbnail cache from all folders and files, as it only needs to update a single folder icon.It changes instantly as well sometimes, but very rarely, and I want it to work 100% of the time. ![]() ico file, I expect to see the result immideiately, but I only see it after 30 seconds to 4 minutes or so. bat, node.js or anything else that would work, I don't mind really). TL DRĮxpected result: I want to programmatically update my folder icon and see that the new icon take place instantly, without waiting. I need to restart explorer / reboot my computer or wait a couple of minutes (randomly) until I see the old icon change to the new icon. After reading a lot and trying for 2 days in a row, I managed to make something work by following this Microsoft tutorial on folder icons, but it's not perfect - changes don't take place immediately. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |