Advertisement
TylerB

Untitled

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