@ECHO OFF&PUSHD %~DP0 &TITLE 绿化
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo.&Echo 请使用右键"以管理员身份运行"!&&Pause >NUL&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion

taskkill /f /im CBox* >NUL 2>NUL

rd/s/q "%temp%\CBox"2>NUL
reg delete HKCU\Software\CBox /F>NUL 2>NUL
reg delete HKCU\Software\CNTV /F>NUL 2>NUL
if exist "%Public%" rd/s/q "%ProgramData%\CBox" 2>NUL
rd/s/q "%AllUsersProfile%\Application Data\CBox" 2>NUL
if exist "%Public%" rd/s/q "%ProgramData%\CBoxService"2>NUL
rd/s/q "%AppData%\CNTV"2>NUL & rd/s/q "%AppData%\CBox"2>NUL
reg add "HKCU\Software\CBox Workshop"  /f /ve /d "%~dp0\" >NUL
reg delete HKLM\SYSTEM\CurrentControlSet\services\CntvCBoxService /f>NUL 2>NUL
reg delete HKLM\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_CNTVCBOXSERVICE /f>NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "CBoxService" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "CBoxService" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" /f /v "CBoxService" >NUL 2>NUL

ECHO.&ECHO 绿化完成！创建快捷方式？
ECHO.&ECHO 是按任意键，否直接关闭！&PAUSE >NUL 2>NUL & CLS

mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\央视影音.lnk""):b.TargetPath=""%~dp0CBox.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")

ECHO.&ECHO 创建完成！按任意键退出！&PAUSE >NUL 2>NUL & EXIT