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