@ECHO OFF

cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && reg query "HKU\S-1-5-19" 1>nul 2>nul || (  cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && ""%~s0"" %Apply%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )

taskkill /f /im BitComet* >NUL 2>NUL
taskkill /f /im plugin_eMule* >NUL 2>NUL
regsvr32 /s /u ".\tools\BitCometAgent.dll"
sc stop BITCOMET_HELPER_SERVICE >NUL 2>NUL
sc delete BITCOMET_HELPER_SERVICE >NUL 2>NUL
rd/s/q "%AppData%\BitComet" 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\BitComet" 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\BitComet (64-bit)" 2>NUL
reg delete "HKLM\SOFTWARE\Classes\bc" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\bittorrent" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\BitComet" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\bc" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\.bc!" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\BitCometUnfinishedFile" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\bittorrent" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\magnet" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\MIME" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用BitComet下载" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用BitComet下载全部链接" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\CLSID\{1D506A3E-D3E1-4AF1-819D-645102F91CCB}" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\CLSID\{1D506A3E-D3E1-4AF1-819D-645102F91CCB}" /f /reg:32 >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\Low Rights\DragDrop\{59CABE4F-3BB1-43bf-8AF1-D08E4C6F1660}" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" /f /v "BitComet.exe" >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" /f /v "BitComet_x64.exe" >NUL 2>NUL

ECHO.&ECHO 清理完成！
ECHO.&ECHO GnDown.com
TIMEOUT /t 3 >NUL&EXIT