@ECHO OFF
SET APPNAME=Libre Hardware Monitor
Title %APPNAME% 卸载清理 & Color 2F
:: CD "%SystemRoot%\system32"
:: CALL :CHECKADMIN
CD /D "%~dp0"
ECHO.
ECHO 正在卸载的软件是「%APPNAME%」
ECHO.
ECHO 脚本作者: 黯然过客
ECHO 发布地址: https://www.portablesoft.org/libre-hardware-monitor/
ECHO.
ECHO * 终止脚本运行请按下 Alt+F4 或点击右上角叉号/关闭按钮 *
ECHO.
PAUSE
ECHO.
TASKKILL /IM LibreHardwareMonitor.exe /T /F
IF %ERRORLEVEL% EQU 0 (
	PING -n 3 127.0.0.1 >nul
)
SCHTASKS /Delete /TN "\LibreHardwareMonitor" /F
DEL /F /S /Q "%LOCALAPPDATA%\Microsoft\*LibreHardwareMonitor.exe.log"
REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Search\JumplistData" /V "%~dp0LibreHardwareMonitor.exe" /F
REG DELETE "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store" /V "%~dp0LibreHardwareMonitor.exe" /F
REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FeatureUsage\AppSwitched" /V "%~dp0LibreHardwareMonitor.exe" /F
:: End Uninstall
CLS
ECHO.
ECHO 彻底清理完毕 by 黯然过客@www.PortableSoft.org
ECHO.
PAUSE
EXIT
:CHECKADMIN
REG QUERY "HKU\S-1-5-19\Environment"
IF NOT %ERRORLEVEL% EQU 0 (
	CLS
	ECHO.
	ECHO 需要管理员权限才能执行 ...
	ECHO.
	ECHO 请右键单击本脚本文件选择「以管理员身份运行」
	ECHO.
	PAUSE & EXIT
)
CLS
GOTO:EOF