@ECHO OFF&PUSHD %~DP0 &TITLE 绿化
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行！&&Pause >nul&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
taskkill /f /im QQDown*>NUL 2>NUL
regsvr32 /s xmain.dll
regsvr32 /s xdownload.dll
regsvr32 /s QQDownload.dll
regsvr32 /s MediaFilter.dll
regsvr32 /s QQIEHelper64.dll
regsvr32 /s QQIEHelper01.dll
regsvr32 /s BT\BTDownload.dll
regsvr32 /s eMule\eMuleDownload.dll
regsvr32 /s TXSSO\Bin\SSOCommon.dll
regsvr32 /s TXSSO\Bin\SSOLUIControl.dll
regsvr32 /s TXSSO\Bin\npSSOAxCtrlForPTLogin.dll
rd/s/q "%AppData%\Tencent\Logs"2>NUL
del"%AppData%\Tencent\QQDownload\Update.ini" >NUL 2>NUL
del/s/q "%AppData%\Tencent\QQDownload\*.xml" >NUL 2>NUL
reg add "HKCU\Software\Tencent\QQDownload" /f /v Install /d "%~dp0\" >NUL
reg add "HKCU\Software\Tencent\QQDownload" /f /v Version /d "4.8.773.400" >NUL
reg add "HKCU\Software\Tencent\QQDownload" /f /v Exe /d "%~dp0QQDownload.exe" >NUL
if not exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Tencent\QQDownload" /f /v Install /d "%~dp0\" >NUL
if not exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Tencent\QQDownload" /f /v Version /d "4.8.773.400" >NUL
if not exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Tencent\QQDownload" /f /v Exe /d "%~dp0QQDownload.exe" >NUL
if exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Wow6432Node\Tencent\QQDownload" /f /v Install /d "%~dp0\" >NUL
if exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Wow6432Node\Tencent\QQDownload" /f /v Version /d "4.8.773.400" >NUL
if exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Wow6432Node\Tencent\QQDownload" /f /v Exe /d "%~dp0QQDownload.exe" >NUL
reg add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用旋风下载" /f /ve /d "%~dp0xfgeturl.htm" >NUL
reg add "HKCU\Software\Microsoft\Internet	Explorer\MenuExt\使用旋风下载" /f /v Contexts /t REG_DWORD /d "0x00000022" >NUL
reg add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用旋风极速下载" /f /ve /d "%~dp0xftopspeed.htm" >NUL
reg add "HKCU\Software\Microsoft\Internet	Explorer\MenuExt\使用旋风极速下载" /f /v Contexts /t REG_DWORD /d "0x00000022" >NUL
::reg add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用旋风下载全部链接" /f /ve /d "%~dp0xfgetAllurl.htm" >NUL
::reg add "HKCU\Software\Microsoft\Internet	 Explorer\MenuExt\使用旋风下载全部链接" /f /v Contexts /t REG_DWORD /d "0x000000f3" >NUL
::reg add "HKCU\Software\Microsoft\Internet Explorer\MenuExt\保存到旋风空间(会员特权)" /f /ve /d "%~dp0xfofflineonly.htm" >NUL
::reg add "HKCU\Software\Microsoft\Internet	 Explorer\MenuExt\保存到旋风空间(会员特权)" /f /v Contexts /t REG_DWORD /d "0x00000022" >NUL
:Menu
echo.&echo 1.创建桌面QQ旋风快捷方式
echo.&echo 2.设为默认浏览器下载工具
echo.&echo.
set /p a=输入数字回车：
IF NOT "%a%"=="" SET a=%a:~0,1%
if "%a%"=="1" Goto DesktopLnk
if "%a%"=="2" Goto SetBrowser
echo.&echo 输入无效，请重新输入！ 
PAUSE >NUL && CLS && GOTO Menu
:SetBrowser
start /wait /B "" "%~dp0win7_setting_32.exe" set_ie=1 SW_HIDE
start /wait /B "" "%~dp0win7_setting_32.exe" set_chrome=1 SW_HIDE
start /wait /B "" "%~dp0win7_setting_32.exe" set_360chrome=1 SW_HIDE
start /wait /B "" "%~dp0win7_setting_32.exe" set_360se=1 SW_HIDE
start /wait /B "" "%~dp0win7_setting_32.exe" set_sogo=1 SW_HIDE
start /wait /B "" "%~dp0win7_setting_32.exe" set_world=1 SW_HIDE
start /wait /B "" "%~dp0win7_setting_32.exe" set_TT=1 SW_HIDE
reg delete "HKLM\Software\Google\Chrome\Extensions\nobfdmmammchijbkljbjkalkjjbhcgdp" /F>NUL 2>NUL
reg delete "HKLM\Software\Wow6432Node\Google\Chrome\Extensions\nobfdmmammchijbkljbjkalkjjbhcgdp" /F>NUL 2>NUL
reg add "HKCU\Software\Tencent\QQBrowser\Download" /f /v DefaultDownloader  /t REG_DWORD /d "0x00000003" >NUL

if not exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\MozillaPlugins\@qq.com/QQDownloadPlugin" /f /v Path /d "%~dp0Browser\773\npXFPlugin.dll" >NUL

if exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Wow6432Node\MozillaPlugins\@qq.com/QQDownloadPlugin" /f /v Path /d "%~dp0Browser\773\npXFPlugin.dll" >NUL

reg add "HKLM\Software\Google\Chrome\NativeMessagingHosts\com.qq.xf.download" /f /ve /d "%~dp0Browser\Chrome\QQDownload_Chrome_nativeMessage\1.2_0\com.qq.xf.download.json" >NUL

if not exist "%WinDir%\SysWOW64" reg add "HKLM\Software\Wow6432Node\Google\Chrome\NativeMessagingHosts\com.qq.xf.download" /f /ve /d "%~dp0Browser\Chrome\QQDownload_Chrome_nativeMessage\1.2_0\com.qq.xf.download.json" >NUL

CLS && ECHO.&ECHO 绿化完成，任意键返回！&&PAUSE >NUL && CLS && GOTO MENU

:DesktopLnk
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\QQ旋风.lnk""):b.TargetPath=""%~dp0QQDownload.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")

CLS && ECHO.&ECHO 创建完成，任意键返回！&&PAUSE >NUL && CLS && GOTO MENU