@ECHO OFF&PUSHD %~DP0 &TITLE 绿化
taskkill /f /im QQDown*>NUL 2>NUL
rd/s/q "%AppData%\Tencent\Logs"2>NUL
regsvr32 /s TXSSO\Bin\SSOCommon.dll
regsvr32 /s TXSSO\Bin\SSOLUIControl.dll
regsvr32 /s TXSSO\Bin\npSSOAxCtrlForPTLogin.dll
del"%AppData%\Tencent\QQDownload\Update.ini" >NUL 2>NUL
del/s/q "%AppData%\Tencent\QQDownload\*.xml" >NUL 2>NUL
if exist "%WinDir%\SysWOW64" regsvr32 /s QQIEHelper64.dll
if not exist "%WinDir%\SysWOW64" regsvr32 /s QQIEHelper01.dll
reg add "HKCU\Software\Tencent\QQDownload" /f /v Install /d "%~dp0\" >NUL
reg add "HKCU\Software\Tencent\QQDownload" /f /v Version /d "4.7.768.202" >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.7.768.202" >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.7.768.202" >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 "%a%"=="1" Goto DesktopLnk
if "%a%"=="2" Goto SetBrowser
: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\768\npXFPlugin.dll" >NUL
if exist "%WinDir%\SysWOW64" reg add "HKLM\SOFTWARE\Wow6432Node\MozillaPlugins\@qq.com/QQDownloadPlugin" /f /v Path /d "%~dp0Browser\768\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
SET E=完成!&GOTO MSGBOX
: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")&SET E=完成!&GOTO MSGBOX
:MsgBox
if "%1"=="" mshta VBScript:MsgBox("%e%",vbSystemModal,"")(close)& Cls&Goto Menu