gurustotal.blogg.se

How to change bat file icon
How to change bat file icon







how to change bat file icon

(ByVal hwnd As Long, ByVal msg As Long, _īyVal wParam As Long, ByVal lParam As Long, _īyVal fuFlags As Long, ByVal uTimeout As Long, _ Private Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" _ ' Send HWND_BROADCAST to refresh the icons again.īut without something to wrap the DLL call in, you will be unable to do this via vbs SysVarReg.RegWrite "HKCU\Control Panel\Desktop\WindowMetrics\Shell Icon Size", icon_size SendMessageTimeout HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, 0, SMTO_ABORTIFHUNG, 10000, result ' Send HWND_BROADCAST to refresh the icons. SysVarReg.RegWrite "HKCU\Control Panel\Desktop\WindowMetrics\Shell Icon Size", new_icon_size Icon_size = SysVarReg.RegRead ("HKCU\Control Panel\Desktop\WindowMetrics\Shell Icon Size") Set SysVarReg = WScript.CreateObject("WScript.Shell") ' ByVal fuFlags As Long, ByVal uTimeout As Long, _ ' ByVal wParam As Long, ByVal lParam As Long, _ ' (ByVal hwnd As Long, ByVal msg As Long, _ 'Private Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" _ I have pared down the program to this: 'SendMessageTimeout values What it does is to examine the value of HKCU\Control Panel\Desktop\WindowMetrics\Shell Icon Size, subtract 1 from it, forces a timeout via SendMessageTimeout, then resets the value, and repeats the timeoutĭue to the fact you cannot call a DLL from vbs (without an external program), this may not give you what you need. This page has a VB program that rebuilds the cache (look at m for the actual code) I also tried adding the registry entries via VBS instead, but that didn't help.Īny batch or VBScript solutions are welcome! I'm positive of this since I don't have iconcache.db files anywhere on my OS drive. And it doesn't restart explorer.exe or remove any files (like some solutions do). But once again, I can't access this tool via batch or VBS. I also have a copy of TuneUp Utilities, which has an option for reloading the icon cache, and this does work like intended. Not to mention, if I do it that way, all open explorer windows will close down, and that's a little bothersome. Restarting explorer.exe DOES work, but if I do that, the application tabs in the task bar become buggy for some reason (e.g.: when an application is maximized, I can't just left click the tab in the task bar to minimize it anymore - I have to actually right click it and hit minimize.). But this can't be done via batch or VBS as far as I know.

how to change bat file icon

The icons are updated if I just hit the "change icon" button for any file type and exit the Folder Options window. The icon(s) show like they should in the list in Folder Options, but the icons aren't updated on the desktop or in explorer. For example, if I execute this batch code: REG ADD HKCR\testfile\DefaultIcon /ve /d "C:\test.ico,0" /f NOT from the Folder Options window in explorer), the icon(s) aren't being updated.









How to change bat file icon