|
本帖最后由 BEIKING 于 2024-6-12 13:22 编辑
基于 curl.exe,Win10以前系统不能用该脚本。
适配桌面正常系统与PE系统。
- @echo off
- if /i "%UserName%" == "SYSTEM" (Goto GotAdmin) else (reg query "HKLM\SYSTEM\ControlSet001\Control\MiniNT" 1>nul 2>nul&&Goto GotAdmin)
- :BatchGotAdmin
- Set _Args=%*
- if `%1` neq `` Set "_Args=%_Args:"=""%"
- if exist %WinDir%\System32\fltMC.exe fltMC 1>nul 2>nul||mshta VBScript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c """"%~f0"" %_Args%""",,"runas",1)(Window.Close) 2>nul&&Exit /b
- :GotAdmin
- Pushd "%CD%"&cd /d "%~dp0"
- Title QQ在线静默安装&(if exist %WinDir%\System32\ureg.dll Mode 82,21 2>nul)&Color 2f
- if defined CommonProgramW6432 (Set "QQScLauncher=%ProgramFiles(x86)%\Tencent\QQ\Bin\QQScLauncher.exe") else Set "QQScLauncher=%ProgramFiles%\Tencent\QQ\Bin\QQScLauncher.exe"
- if exist "%QQScLauncher%" (Goto RunQQ) else Set n=0&Goto GetUrl
- :GetUrl
- Set /a n+=1
- chcp 65001 1>nul 2>nul
- Set url=&for /f "delims=" %%i in ('curl -s https://cdn-go.cn/qq-web/im.qq.com_new/latest/rainbow/windowsDownloadUrl.js') do for %%j in (%%i) do for /f "tokens=1,* delims=:" %%k in ('echo,"%%~j"') do if /i "%%~k" == "downloadUrl" Set "url=%%~l"
- if not defined url if %n% leq 20 (Set /p="_ ."<nul&Goto GetUrl) else chcp 936 1>nul 2>nul&Call :EchoX "cf.:_Download JS file error_"&Pause >nul&Exit /b
- chcp 936 1>nul 2>nul
- :DownQQ
- Cls&Call :EchoX "9f.: 正在下载QQ,请稍等 。。。"&echo.
- if not exist "%~dp0QQ.exe" (aria2c -h 1>nul 2>nul&&aria2c "%url%" -o QQ.exe||curl "%url%" -l -o QQ.exe) else Cls
- echo.&if not exist "%~dp0QQ.exe" (Call :EchoX "9f:: 下载链接: "&echo %url%&Call :EchoX "cf.: 下载出错!请检查下载链接。"&Pause >nul) else (Call :EchoX "9f.: 正在安装QQ,请稍等 。。。"&QQ.exe /s 1>nul 2>nul&del /q "%~dp0QQ.exe" 2>nul)
- Exit /b
- :RunQQ
- @start "" "%QQScLauncher%" 1>nul 2>nul
- Exit /b
- :EchoX
- Setlocal EnableDelayedExpansion
- Set echox=EchoX.exe&&!echox! 1>nul 2>nul||(Set echox=&mkdir "%TEMP%\EchoX" 2>nul&&attrib +s +h "%TEMP%\EchoX" 2>nul)
- for %%a in (%*) do (
- Set "param=%%~a"&Set "color=!param:~0,2!"&(if not exist %WinDir%\System32\findstr.exe if not defined echox Set "color=xx")
- Set n=0&(if "!param:~2,2!" == "::" Set n=1)&(if "!param:~2,2!" == ".:" Set n=2)
- if !n! gtr 0 (
- if /i "!color!" == "xx" (Set /p="_!param:~4!"<nul) else (Set param=%%~nxa&if defined echox (!echox! -c !color! -n "!param:~4!") else (Pushd "%TEMP%\EchoX" 2>nul&>"!param:~4!",Set /p= <nul&findstr /a:!color! .* "!param:~4!*"&del "!param:~4!"&Popd))
- if !n! == 2 echo.
- ) else if defined param Set /p="_!param!"<nul
- )
- Endlocal&Goto :eof
复制代码
复制代码到记事本保存,请务必保存为 ANSI 格式,UTF-8会报错
|
评分
-
查看全部评分
|