当前位置: 代码迷 >> VB >> 重建图标缓存的两个脚本-bat下令和vbs文件
  详细解决方案

重建图标缓存的两个脚本-bat下令和vbs文件

热度:6977   发布时间:2013-02-26 00:00:00.0
重建图标缓存的两个脚本--bat命令和vbs文件

第一个是用bat批处理命令,可以正常执行

rem 关闭Windows外壳程序explorertaskkill /f /im explorer.exerem 清理系统图标缓存数据库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"rem 清理 系统托盘记忆的图标echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreamsecho y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStreamrem 重启Windows外壳程序explorerstart explorer

第二个是vbs文件,提示错误,希望懂得vb的同学给我指正....

On Error Resume NextIf MsgBox("将关闭所有打开的资源管理器窗口,并重建图标缓存。" _& vbCrLf & "是否继续?",vbYesNo+vbQuestion,"询问")= vbNo ThenWscript.QuitEnd IfSet FSO = CreateObject("Scripting.FileSystemObject")FSO.DeleteFile(FSO.GetSpecialFolder(0) & "\shelliconcache")Set FSO = NothingSet Pros = GetObject("winmgmts:\\.\root\cimv2").ExecQuery ("Select * from Win32_Process Where Name = 'explorer.exe'")For Each Pro in ProsPro.TerminateNextSet Pros = NothingMsgBox "操作已完成。",vbInformation,"提示"

提示的错误是


  相关解决方案