@Echo Off
Title 绿化卸载
Pushd %~dp0
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" (Set a="HKLM\SOFTWARE\Wow6432Node\Thunder Network\ThunderOem\thunder_backwnd" /v&Set b=%SystemRoot%\SysWOW64) Else (Set a="HKLM\SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" /v&Set b=%SystemRoot%\system32)
:Menu
Cls
If Exist "%b%\Tasklist.exe" Tasklist|Find /i "thunder.exe">nul&&(Echo 请先退出迅雷，按任意键重试&&Pause >nul&&Goto Menu)
If Not "%1"=="" (Set c=%1&Goto Goto)
Echo.
Echo 1.绿化
Echo.
Echo 2.卸载
Echo.
Echo 3.注册IE右键下载 ( 自选 )
Echo.
Echo 4.创建桌面 迅雷VIP尊享版 快捷方式 
Echo.
Echo 5.退出
Echo.
:Menu
Set /p Memories=请输入：
If "%Memories%"=="1" Goto In
If "%Memories%"=="2" Goto Un
If "%Memories%"=="3" Goto RI
if "%Memories%"=="4" Goto Lnk
If "%Memories%"=="5" Goto Exit
Echo.&Echo 输入无效，请重新输入！
pause >nul
Goto Menu
:In
BHO\XLNonIESvr.exe -u ie -silent 
BHO\XLNonIESvr.exe -u opera -silent 
BHO\XLNonIESvr.exe -u chrome -silent
BHO\XLNonIESvr.exe -u firefox -silent
BHO\XLNonIESvr.exe -u theworld -silent
BHO\XLNonIESvr.exe -u SogouExplorer -silent
Regsvr32 /s /u BHO\XunLeiBHO.dll
Regsvr32 /s /u BHO\ThunderAgent.dll
Regsvr32 /s /u BHO\Platform\np_tdieplat.dll
If Exist "BHO\XlBrowserAddin.dll" Regsvr32 /s /u BHO\XlBrowserAddin.dll
If Exist "BHO\XlBrowserAddinKernel.dll" Regsvr32 /s /u BHO\XlBrowserAddinKernel.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\Software\thunder" /f >nul 2>nul
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 "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 "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /f >nul 2>nul
Reg Delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\{889D2FEB-5411-4565-8998-1DD2C5261283}" /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
copy /y Program\Microsoft.VC90.ATL.manifest BHO\Microsoft.VC90.ATL.manifest >nul 2>nul
copy /y Program\Microsoft.VC90.CRT.manifest BHO\Microsoft.VC90.CRT.manifest >nul 2>nul
copy /y Program\atl90.dll BHO\atl90.dll >nul 2>nul
copy /y Program\msvcp90.dll BHO\msvcp90.dll >nul 2>nul
copy /y Program\msvcr90.dll BHO\msvcr90.dll >nul 2>nul
BHO\XLNonIESvr.exe -r ie -silent -setfirst
BHO\XLNonIESvr.exe -r 360 -silent -setfirst
BHO\XLNonIESvr.exe -r opera -silent -setfirst
BHO\XLNonIESvr.exe -r maxthon -silent -setfirst
BHO\XLNonIESvr.exe -r theworld -silent -setfirst
BHO\XLNonIESvr.exe -r firefox -silent -setfirst
BHO\XLNonIESvr.exe -r chrome -silent -setfirst
BHO\XLNonIESvr.exe -r SogouExplorer -silent -setfirst
Regsvr32 /s BHO\ThunderAgent.dll >nul 2>nul
Regsvr32 /s BHO\Platform\np_tdieplat.dll >nul 2>nul
Reg Add %a% "Path" /d "%~dp0Program\Thunder.exe" /f >nul 2>nul
Reg Add %a% "dir" /d "%~dp0\" /f >nul 2>nul
Reg Add %a% "instdir" /d "%~dp0\" /f >nul 2>nul
Reg Add %a% "addinsdir" /d "%~dp0Addins" /f >nul 2>nul
Reg Add %a% "Version" /d "7.99.12.258" /f >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
Del /f /q "%AppData%\Microsoft\Windows\Libraries\迅雷下载.library-ms" 2>nul
SET E=绿化完成!&GOTO MSGBOX
:RI
Reg Add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /ve /d "%~dp0BHO\geturl.htm" /f >nul 2>nul
Reg Add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /v "Contexts" /t REG_DWORD /d "0x00000022" >nul 2>nul
SET E=完成!&GOTO MSGBOX
:Un
BHO\XLNonIESvr.exe -u ie -silent 
BHO\XLNonIESvr.exe -u opera -silent 
BHO\XLNonIESvr.exe -u chrome -silent
BHO\XLNonIESvr.exe -u firefox -silent
BHO\XLNonIESvr.exe -u theworld -silent
BHO\XLNonIESvr.exe -u SogouExplorer -silent
Regsvr32 /s /u BHO\ThunderAgent.dll
Regsvr32 /s /u BHO\XunLeiBHO.dll
Regsvr32 /s /u BHO\Platform\np_tdieplat.dll
If Exist "BHO\XlBrowserAddin.dll" Regsvr32 /s /u BHO\XlBrowserAddin.dll
If Exist "BHO\XlBrowserAddinKernel.dll" Regsvr32 /s /u BHO\XlBrowserAddinKernel.dll
If Exist "BHO\xlfxctrl.dll" Regsvr32 /s /u BHO\xlfxctrl.dll
If Exist "BHO\UserAgent.dll" Regsvr32 /s /u BHO\UserAgent.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\Software\thunder" /f >nul 2>nul
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 "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\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\{889D2FEB-5411-4565-8998-1DD2C5261283}" /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
Rd /s /q "%PUBLIC%\Documents\Thunder Network\XLFX" >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 /q "%SystemDrive%\TDDOWNLOAD" >nul 2>nul
Rd /s /q "Skin\autoskin" >nul 2>nul
Rd /s /q "Skin\recommend" >nul 2>nul
Rd /s /q "%p%\..\Skin\autoskin" >nul 2>nul
Rd /s /q "%p%\..\Skin\recommend" >nul 2>nul
Rd /s /q "%p%\AppleAssistant" >nul 2>nul
Rd /s /q "%p%\icondir" >nul 2>nul
Rd /s /q "%p%\Community\VipAssistant" >nul 2>nul
Rd /s /q "%p%\Community\XMLPaint" >nul 2>nul
Rd /s /q "%p%\platform" >nul 2>nul
Rd /s /q "%p%\pluginpanel" >nul 2>nul
Rd /s /q "%p%\MsgSys" >nul 2>nul
Rd /s /q "%p%\SkinRecommendIcon" >nul 2>nul
Rd /s /q "%p%\ThunderAddin" >nul 2>nul
Rd /s /q "%p%\ThunderNavigator" >nul 2>nul
Rd /s /q "%p%\VipService\Scene" >nul 2>nul
Rd /s /q "%p%\XLDaQuan" >nul 2>nul
Rd /s /q "Addins\HideTaskInfoAddin" >nul 2>nul
Rd /s /q "Addins\Update" >nul 2>nul
If Exist "%ProgramData%" (Rd /s /q "%ProgramData%\Thunder Network\Thunder\Addins\Community" >nul 2>nul
Rd /s /q "%ProgramData%\Thunder Network\Thunder\Addins\HideTaskInfoAddin" >nul 2>nul
Rd /s /q "%ProgramData%\Thunder Network\Thunder\Addins\VipService" >nul 2>nul
Del /f /q "%ProgramData%\Thunder Network\Thunder\Addins\addins*.*" >nul 2>nul)
Del /f /q "Addins\addins*.*" >nul 2>nul
Del /f /q "%p%\Community\*.png" >nul 2>nul
Del /f /q "%p%\Community\*.xml" >nul 2>nul
Del /f /q "%p%\Community\welcome.jpg" >nul 2>nul
Del /f /q "%p%\P2pShare\linkdata.xml" >nul 2>nul
Del /f /q "%p%\P2pShare\thumb*.png" >nul 2>nul
Del /f /q "BHO\*.?.?.*.dll" >nul 2>nul
SET E=卸载完成!&GOTO MSGBOX
:Lnk
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\迅雷VIP尊享版.lnk""):b.TargetPath=""%~dp0Program\Thunder.exe"":b.WorkingDirectory=""%~dp0Program\"":b.Save:close")&SET E=创建完成!&GOTO MSGBOX
:MsgBox
if "%1"=="" mshta VBScript:MsgBox("%e%",vbSystemModal,"")(close)& Cls&Goto Menu
:Exit
Popd