Advertisement
paranoidsbible

Reset Notification Area Icons Cache (save as .bat)

Jan 3rd, 2018
221
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 1 0
  1. @echo off
  2. cls
  3. set regPath=HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify
  4. set regKey1=IconStreams
  5. set regKey2=PastIconsStream
  6. set choice=Bad-Response
  7.  
  8. echo The Explorer process must be killed to reset the Notification Area Icons Cache.
  9. echo.
  10. echo Please SAVE ALL OPEN WORK before continuing
  11. echo.
  12. pause
  13.  
  14. echo.
  15. taskkill /IM explorer.exe /F
  16. echo.
  17. FOR /F "tokens=*" %%a in ('Reg Query "%regpath%" /v %regkey1% ^| find /i "%regkey1%"') do goto iconstreams
  18. echo Registry key "IconStreams" already deleted.
  19. echo.
  20.  
  21. :verify-PastIconsStream
  22. FOR /F "tokens=*" %%a in ('Reg Query "%regpath%" /v %regkey2% ^| find /i "%regkey2%"') do goto PastIconsStream
  23. echo Registry key "PastIconsStream" already deleted.
  24. echo.
  25. goto confirm-restart
  26.  
  27. :iconstreams
  28. reg delete "%regpath%" /f /v "%regkey1%"
  29. goto verify-PastIconsStream
  30.  
  31. :PastIconsStream
  32. reg delete "%regpath%" /f /v "%regkey2%"
  33.  
  34. :confirm-restart
  35. echo.
  36. echo.
  37. echo Windows must be restarted to finish resetting the Notification Area Icons.
  38. echo.
  39.  
  40. :wrong
  41. set /p choice=Restart now? (Y/N) and press Enter:
  42. If %choice% == y goto Yes
  43. If %choice% == Y goto Yes
  44. If %choice% == n goto No
  45. If %choice% == N goto No
  46. set choice=Bad-Response
  47. goto wrong
  48.  
  49. :Yes
  50. shutdown /R /f /t 00
  51. exit
  52.  
  53. :No
  54. echo.
  55. echo Restart aborted. Please remember to restart the computer later.
  56. echo.
  57. echo You can now close this command prompt window.
  58. explorer.exe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement