@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

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

rd /s /q "%~dp0userdata" 2>NUL
rd /s /q "%temp%\CBox" 2>NUL
rd /s /q "%temp%\CBoxDump" 2>NUL
rd /s /q "%AppData%\CNTV" 2>NUL
rd /s /q "%AppData%\CBox" 2>NUL
rd /s /q "%UserProfile%\CBoxDump" 2>NUL

ver|findstr "5\.[0-9]\.[0-9][0-9]*" > NUL && (
rd /s /q "%AllUsersProfile%\Application Data\CBox" 2>NUL
rd /s /q "%AllUsersProfile%\Application Data\CBoxService"2>NUL
del/q "%UserProfile%\桌面\央视影音.lnk" >NUL 2>NUL
del/q "%AllUsersProfile%\桌面\央视影音.lnk" >NUL 2>NUL
rd/s/q "%UserProfile%\「开始」菜单\程序\央视影音"2>NUL
rd/s/q "%AllUsersProfile%\「开始」菜单\程序\央视影音"2>NUL
)
ver|findstr "\<6\.[0-9]\.[0-9][0-9]*\> \<10\.[0-9]\.[0-9][0-9]*\>" > NUL && (
if exist "%Public%" rd /s /q "%ProgramData%\CBox" 2>NUL
rd /s /q "%UserProfile%\AppData\Local\CBoxService"2>NUL
rd /s /q "%ProgramData%\CBoxService"2>NUL
del/q "%Public%\Desktop\央视影音.lnk" >NUL 2>NUL
del/q "%UserProfile%\Desktop\央视影音.lnk" >NUL 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\央视影音"2>NUL
rd/s/q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\央视影音"2>NUL
)

reg delete "HKCR\CBox" /F>NUL 2>NUL
reg delete "HKCU\Software\CBox" /F>NUL 2>NUL
reg delete "HKCU\Software\CNTV" /F>NUL 2>NUL
reg delete "HKCU\Software\CBox Workshop" /F>NUL 2>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\Classes\CLSID\{5a508685-a254-4fba-9b82-9a24b00306af}" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{6a93130e-1d53-41d1-a9cf-e758800bb179}" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{cac1105f-619b-4d04-831a-44e1cbf12d57}" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{5a508685-a254-4fba-9b82-9a24b00306af}" /F /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{6a93130e-1d53-41d1-a9cf-e758800bb179}" /F /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{cac1105f-619b-4d04-831a-44e1cbf12d57}" /F /reg:32 >NUL 2>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\Microsoft\Windows\CurrentVersion\Run" /f /v "CBoxService" /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CBox" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CBox" /f /reg:32 >NUL 2>NUL

CLS&ECHO.&ECHO 清除完成，删除软件?[敲1]
CHOICE /C 1 /N >NUL 2>NUL
IF "%ERRORLEVEL%"=="1" PUSHD .. & RD /S/Q "%~DP0" >NUL 2>NUL