@ECHO OFF&PUSHD %~DP0 &TITLE 迅雷极速版绿化卸载 _Aaron 2015.12.17
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo.&Echo 请使用右键“以管理员身份运行”&&Pause >NUL&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion

:Menu
Echo.&Echo  1.绿化
Echo.&Echo  2.卸载
Echo.&Echo  3.添加IE右键下载菜单 ( 自选 )
Echo.&Echo  4.移除IE右键下载菜单 ( 默认 )
Echo.&Echo  5.启用边下边播功能 ( 自选 )
Echo.&Echo  6.禁用边下边播功能 ( 默认 )
Echo.&Echo  7.启用谷歌浏览器扩展支持 ( 自选 )
Echo.&Echo  8.禁用谷歌浏览器扩展支持 ( 默认 )
Echo.&Echo  +.创建桌面极速迅雷快捷方式
Echo.&Echo.
set /p a=输入数字按回车：
IF NOT "%a%"=="" SET a=%a:~0,1%
If "%a%"=="1" Goto In
If "%a%"=="2" Goto Un
If "%a%"=="3" Goto RI
If "%a%"=="4" Goto DelRI
If "%a%"=="5" Goto AddXmp
If "%a%"=="6" Goto DelXmp
If "%a%"=="7" Goto BhoChrome
If "%a%"=="8" Goto XBChrome
if "%a%"=="+" Goto Lnk
Echo.&Echo 输入无效，请重新输入！
PAUSE >NUL & CLS & GOTO Menu

:In
taskkill /f /im Thunder* >NUL 2>NUL
Regedit /s Program\TdspDel.reg
Regsvr32 /s /u Bho\ThunderAgent.dll
Regsvr32 /s /u Bho\Platform\np_tdieplat.dll
Program\Thunder.exe -unassociate:td -unassociate:torrent -unassociate:downlist -unassociate:thunderskin -unassociate:thunderaddin -unassociate:all -unregprotocol:ed2k -unregprotocol:magnet -unregprotocol:thunder -unregprotocol:xlapplink
Reg Delete "HKCR\Xunlei.Bittorrent.6" /f >nul 2>nul
Reg Delete "HKCR\Xunlei.LSTFile.6" /f >nul 2>nul
Reg Delete "HKCR\Xunlei.TDFile.6" /f >nul 2>nul
Reg Delete "HKCR\Xunlei.ThunderSkin.6" /f >nul 2>nul
Reg Delete "HKCR\Software\thunder" /f >nul 2>nul
Reg Delete "HKLM\Software\Thunder Network" /f >nul 2>nul
Reg Delete "HKCU\Software\Thunder Network" /f >nul 2>nul
Reg Delete "HKLM\Software\Wow6432Node\Thunder Network" /f >nul 2>nul
Reg Delete "HKLM\Software\Google\Chrome\NativeMessagingHosts" /f >nul 2>nul
Reg Delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /f >nul 2>nul
Reg Delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" /f >nul 2>nul
Reg Delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷离线下载" /f >nul 2>nul
Rd /s /q "%TMP%\Xunlei" >nul 2>nul
Rd /s /q "%TMP%\Thunder" >nul 2>nul
Rd /s /q "%TMP%\ThunderLiveUD" >nul 2>nul
Rd /s /q "%TMP%\Thunder Network" >nul 2>nul
If Exist "%PUBLIC%" Rd /s /q "%PUBLIC%\Thunder Network" >nul 2>nul
If Exist "%PUBLIC%" Rd /s /q "%PUBLIC%\Documents\Thunder Network" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Application Data\Thunder Network" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Application Data\Xunlei" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Xunlei" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Thunder Network" >nul 2>nul
Rd /s /q "%AppData%\Thunder Network" >nul 2>nul
Rd /s /q "%CommonProgramFiles%\Thunder Network" >nul 2>nul
Rd /s /q "%CommonProgramFiles(x86)%\Thunder Network" >nul 2>nul
Rd /s /q "%UserProfile%\Local Settings\Application Data\Thunder Network" 2>NUL
Rd /s /q "%UserProfile%\Local Settings\Application Data\Pusher" 2>NUL
Rd /s /q "%UserProfile%\AppData\LocalLow\Thunder Network" >nul 2>nul
Rd /s /q "%UserProfile%\AppData\LocalLow\XueLei" >nul 2>nul
Rd /s /q "%UserProfile%\My Documents\Thunder"2>NUL
Rd /s /q "%AllUsersProfile%\Application Data\Thunder Network"2>NUL
Rd /s /q Program\SpeedHistory >nul 2>nul
Del /f /q Program\LiveUpdate_storage.xml  >nul 2>nul
Del /f /q "%AppData%\Microsoft\Windows\Libraries\迅雷下载.library-ms" 2>nul
Regsvr32 /s Bho\ThunderAgent.dll
Regsvr32 /s Bho\Platform\np_tdieplat.dll >nul 2>nul
Reg Add HKCR\Xunlei.Bittorrent.6\DefaultIcon /ve /d "%~dp0Program\TorrentFile.ico" /F>NUL
Reg Add HKCR\Xunlei.Bittorrent.6\Shell\Open /ve /d "使用迅雷下载该BT文件" /F>NUL
Reg Add HKCR\Xunlei.Bittorrent.6\Shell\Open\command /ve /d "%~dp0Program\Thunder.exe %%1" /F>NUL
Reg Add HKCR\Xunlei.LSTFile.6\DefaultIcon /ve /d "%~dp0Program\XLDownloadList.ico" /F>NUL
Reg Add HKCR\Xunlei.LSTFile.6\Shell\Open /ve /d "使用迅雷下载该任务列表文件" /F>NUL
Reg Add HKCR\Xunlei.LSTFile.6\Shell\Open\command /ve /d "%~dp0Program\Thunder.exe %%1" /F>NUL
Reg Add HKCR\Xunlei.TDFile.6\DefaultIcon /ve /d "%~dp0Program\XLTempFile.ico" /F>NUL
Reg Add HKCR\Xunlei.TDFile.6\Shell\Open /ve /d "使用迅雷下载未完成文件" /F>NUL
Reg Add HKCR\Xunlei.TDFile.6\Shell\Open\command /ve /d "%~dp0Program\Thunder.exe %%1" /F>NUL
if "%PROCESSOR_ARCHITECTURE%"=="x86" Reg Add "HKLM\Software\Thunder Network\ThunderOem\thunder_backwnd" /v dir /d "%~dp0" >nul 2>nul
if "%PROCESSOR_ARCHITECTURE%"=="x86" Reg Add "HKLM\Software\Thunder Network\ThunderOem\thunder_backwnd" /v Path /d "%~dp0Program\Thunder.exe" >NUL 2>nul 
if "%PROCESSOR_ARCHITECTURE%"=="x86" Reg Add "HKLM\Software\Thunder Network\ThunderOem\thunder_backwnd" /v instdir /d "%~dp0" >nul 2>nul
if "%PROCESSOR_ARCHITECTURE%"=="x86" Reg Add "HKLM\Software\Thunder Network\ThunderOem\thunder_backwnd" /v Version /d "7.10.33.358" >nul 2>nul
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" Reg Add "HKLM\Software\Wow6432Node\Thunder Network\ThunderOem\thunder_backwnd" /v dir /d "%~dp0" >nul 2>nul
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" Reg Add "HKLM\Software\Wow6432Node\Thunder Network\ThunderOem\thunder_backwnd" /v Path /d "%~dp0Program\Thunder.exe" >NUL 2>nul
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" Reg Add "HKLM\Software\Wow6432Node\Thunder Network\ThunderOem\thunder_backwnd" /v instdir /d "%~dp0" >nul 2>nul
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" Reg Add "HKLM\Software\Wow6432Node\Thunder Network\ThunderOem\thunder_backwnd" /v Version /d "7.10.33.358" >nul 2>nul
Md "%AllUsersProfile%\Application Data\Thunder Network\cid_store.dat"
Md "%AllUsersProfile%\Application Data\Thunder Network\emule_upload_list.dat"
Md "%AllUsersProfile%\Application Data\Thunder Network\DownloadLib\pub_store.dat"
Program\Thunder.exe -install -associate:all   >nul 2>nul
Echo.&Echo 绿化完成，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:RI
Reg Add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /ve /d "%~dp0BHO\geturl.htm" /f >nul
Reg Add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /v "Contexts" /t REG_DWORD /d "0x00000022" /f >nul
Reg Add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" /ve /d "%~dp0BHO\getAllurl.htm" /f >nul
Reg Add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" /v "Contexts" /t REG_DWORD /d "0x000000f3" /f >nul
Echo.&Echo IE右键下载菜单已添加，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:DelRI
Reg Delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /f >nul 2>nul
Reg Delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" /f >nul 2>nul
Echo.&Echo IE右键下载菜单已移除，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:AddXmp
taskkill /f /im Thunder* >NUL 2>NUL
ren Program\stream.dl_ stream.dll >NUL 2>NUL
start Program\Xmp.ini
CLS & GOTO MENU

:DelXmp
taskkill /f /im Thunder* >NUL 2>NUL
ren Program\stream.dll stream.dl_ >NUL 2>NUL
Regedit /s Program\TdspDel.reg
Echo.&Echo 已禁用边下边播，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:BhoChrome
Reg Add "HKLM\Software\Google\Chrome\NativeMessagingHosts\com.xunlei.thunder" /f /ve /d "%~dp0Bho\Chrome\com.xunlei.thunder.json" >NUL 2>nul
Echo.&Echo 已启用扩展支持，您需从谷歌网上应用店安装官方扩展，方可正常使用！
Echo.&Echo 如已安装官方扩展，可忽略上述提示，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:XBChrome
Reg Delete "HKLM\Software\Google\Chrome\NativeMessagingHosts" /f >nul 2>nul
Echo.&Echo 已禁用扩展支持，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:Lnk
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\极速迅雷.lnk""):b.TargetPath=""%~dp0Program\Thunder.exe"":b.WorkingDirectory=""%~dp0Program\"":b.Save:close")
Echo.&Echo 已创建桌面快捷方式，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU

:Un
taskkill /f /im Thunder* >NUL 2>NUL
Regedit /s Program\TdspDel.reg
Regsvr32 /s /u Bho\ThunderAgent.dll
Regsvr32 /s /u Bho\Platform\np_tdieplat.dll
Program\Thunder.exe -unassociate:td -unassociate:torrent -unassociate:downlist -unassociate:thunderskin -unassociate:thunderaddin -unassociate:all -unregprotocol:ed2k -unregprotocol:magnet -unregprotocol:thunder -unregprotocol:xlapplink
Reg Delete "HKCR\Xunlei.Bittorrent.6" /f >nul 2>nul
Reg Delete "HKCR\Xunlei.LSTFile.6" /f >nul 2>nul
Reg Delete "HKCR\Xunlei.TDFile.6" /f >nul 2>nul
Reg Delete "HKCR\Xunlei.ThunderSkin.6" /f >nul 2>nul
Reg Delete "HKCR\Software\thunder" /f >nul 2>nul
Reg Delete "HKLM\Software\Thunder Network" /f >nul 2>nul
Reg Delete "HKCU\Software\Thunder Network" /f >nul 2>nul
Reg Delete "HKLM\Software\Wow6432Node\Thunder Network" /f >nul 2>nul
Reg Delete "HKLM\Software\Google\Chrome\NativeMessagingHosts" /f >nul 2>nul
Reg Delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /f >nul 2>nul
Reg Delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" /f >nul 2>nul
If Exist "%PUBLIC%" Rd /s /q "%PUBLIC%\Thunder Network" >nul 2>nul
If Exist "%PUBLIC%" Rd /s /q "%PUBLIC%\Documents\Thunder Network" >nul 2>nul
Rd /s /q "%TMP%\LiveUD" >nul 2>nul
Rd /s /q "%TMP%\Thunder" >nul 2>nul
Rd /s /q "%TMP%\Thunder Network" >nul 2>nul
Rd /s /q "%TMP%\ThunderLiveUD" >nul 2>nul
Rd /s /q "%TMP%\xltmp" >nul 2>nul
Rd /s /q "%TMP%\Xunlei" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Application Data\Thunder Network" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Application Data\Xunlei" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Xunlei" >nul 2>nul
Rd /s /q "%AllUsersProfile%\Thunder Network" >nul 2>nul
Rd /s /q "%AppData%\Thunder Network" >nul 2>nul
Rd /s /q "%CommonProgramFiles%\Thunder Network" >nul 2>nul
If Exist "%CommonProgramFiles(x86)%" Rd /s /q "%CommonProgramFiles(x86)%\Thunder Network" >nul 2>nul
Rd /s /q "%UserProfile%\AppData\LocalLow\Thunder Network" >nul 2>nul
Rd /s /q "%UserProfile%\AppData\LocalLow\XunLei" >nul 2>nul
Rd /s /q "%UserProfile%\Local Settings\Application Data\Thunder Network" 2>NUL
Rd /s /q "%UserProfile%\Local Settings\Application Data\Pusher" 2>NUL
Rd /s /q Program\SpeedHistory >nul 2>nul
Del /f /q Program\LiveUpdate_storage.xml  >nul 2>nul
Echo.&Echo 已卸载完成，按任意键返回！&PAUSE >NUL 2>NUL & CLS & GOTO MENU
