Skip to content

Instantly share code, notes, and snippets.

@zoubingwu
Created July 26, 2018 03:17
Show Gist options
  • Save zoubingwu/52e94754310e2e215436e51fa732b24c to your computer and use it in GitHub Desktop.
Save zoubingwu/52e94754310e2e215436e51fa732b24c to your computer and use it in GitHub Desktop.
a bat script that cleans windows notification area.
@echo off
echo - Notification Area Cleaner Script by Raymond.cc -
echo.
set regkey=HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify
choice /m "Backup TrayNotify key to Desktop"
if %errorlevel% == 1 reg export "%regkey%" %userprofile%\desktop\TrayNotifyBackup.reg /y
echo.
reg delete "%regkey%" /v IconStreams /f >nul 2>nul
if %errorlevel% == 0 (echo IconStreams value deleted) else (echo IconStreams value already removed)
reg delete "%regkey%" /v PastIconsStream /f >nul 2>nul
if %errorlevel% == 0 (echo PastIconsStream value deleted) else (echo PastIconsStream value already removed)
echo.
choice /m "Restart Explorer now"
if %errorlevel% == 1 goto restart
if %errorlevel% == 2 goto :eof
:restart
taskkill /im explorer.exe /f
start "" /d "%systemroot%" /i /normal explorer.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment