前言全局说明
如何优雅地设置文件夹图标
作者:富妈 https://www.bilibili.com/read/cv6721286/
一、源码
源码,复制到记事本后另存为bat文件使用
@Echo off & Chcp 936 & Color 0b & MODE con: COLS=60 LINES=12>nul
@Title tf2713 批量更改文件夹图标工具!
::----------------------------------------------------------------
echo.
echo *************************************************
echo * *
echo * 1.处理后会生成和图标同名的美化文件夹 *
echo * *
echo * 2.请把图标和本批处理放在同一个目录下 *
echo * *
echo * 3.按任意键或等待5秒即可开始 !by tf2713 *
echo * *
echo *************************************************
echo.
::----------------------------------------------------------------
@timeout /t 5 >nul
::----------------------------------------------------------------
for /f "tokens=*" %%i in ('dir /b /a-d *.ico') do (
md "%%~ni">nul
ren "%%i" "&M&m-gb5l-SgSN-%%i"
move "&M&m-gb5l-SgSN-%%i" "%%~ni\">nul
(echo [.ShellClassInfo]
echo IconResource="&M&m-gb5l-SgSN-%%i",0
)>"%%~ni\desktop.ini"
attrib +s +h "%%~ni\desktop.ini"
attrib +s +h "%%~ni\&M&m-gb5l-SgSN-%%i"
attrib +r /s /d "%%~ni"
)
::----------------------------------------------------------------
echo.
echo.
echo 若文件夹图标修改成功,请按任意键关闭程序
echo.
set /p a=若文件夹图标无变化,输入 1 刷新图标缓存:
echo.
for %%i in (%a%) do (
if %%i==1 call :aa
)
echo.
exit
:aa
taskkill /f /im explorer.exe
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
del /f "%userprofile%\AppData\Local\IconCache.db"
attrib /s /d -h -s -r "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_32.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_96.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_102.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_256.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_1024.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_idx.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_sr.db"
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream
start explorer
免责声明:本号所涉及内容仅供安全研究与教学使用,如出现其他风险,后果自负。
参考、来源:
https://www.bilibili.com/read/cv6721286/