bat批处理禁止迅雷强制升级
本帖最后由 Sring65 于 2022-4-22 11:11 编辑更新了下,安装了抢先版本迅雷11版测试了下可以禁止、屏蔽发现页。
bat批处理禁止迅雷强制升级,迅雷急速版添加成功,其他版本未测试,
添加禁止访问权限权限Thunder Network\Thunder\Data\ThunderPush
下载脚本:迅雷极速版禁止更新.bat https://sring65.lanzouv.com/ij6e3014nblg
@echo off
chcp >nul||set "Path=%Path%;%systemroot%\System32;"
REG QUERY "HKU\S-1-5-19" >nul 2>&1||(start /b mshta vbscript:createobject("shell.application"^).shellexecute("%~s0","","","runas",1^)(window.close^)&exit)
set "findString=迅雷"
echo 准备禁止迅雷升级设置
setLocal EnableDelayedExpansion
Choice /d y /t 3 /m "将在3s后将运行检测,是否继续执行"
if !errorlevel!==2 goto :eof
for /f "tokens=2,*" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Thunder" /v "UninstallString" 2^>nul') do (
set "EXEPath=%%~dpj"
echo EXEPath=!EXEPath!
if exist "!EXEPath!\Data\"call :CalcsPath & pause
)
if /i %PROCESSOR_IDENTIFIER:~0,3%==x86 (
goto x86
) else (
goto x64
)
:x64
set "regquery32=/reg:32"
set rp=HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
echo %rp%
call :getInstallPath
set "regquery32=/reg:64"
:x86
set rp=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
echo %rp%
rem call :start
call :getInstallPath
echo 运行结束
pause
exit
:getInstallPath
rem 查找安装名称%findString%
for /f "tokens=*" %%a in ('reg query "%rp%" %regquery32% 2^>nul^|more +2') do (
call :waitString
reg query "%%a" /v "DisplayName"%regquery32%2>nul |more +2 |findstr /i "%findString%">nul 2>&1 && (
rem 获取安装路径
set EXEPath=""
echo %%a
for /f "tokens=2,*" %%i in ('reg query "%%a" %regquery32% /v "InstallLocation" 2^>nul') do (
set "EXEPath=%%j"
echo EXEPath=!EXEPath!
if exist "!EXEPath!\Data\"call :CalcsPath
rem if exist "!EXEPath!\Fonts\" call :EXEFontCp
)
:: 没有查找到安装目录
if !EXEPath!=="" (
for /f "tokens=2,*" %%i in ('reg query "%%a" %regquery32% 2^>nul ^|more +2 ^|findstr ":\\"') do (
set "EXEPath=%%~dpj"
echo EXE路径:!EXEPath!
call :CalcsPath
)
)
)
)
goto :eof
:desktopchek
echo 获取桌面路径
For /f "tokens=2,*" %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Desktop"') do set "Desktop=%%j"
echo %Desktop%
rem 检查桌面快捷链接
for /f "tokens=*" %%a in ('dir /b/s "%Desktop%\*.lnk" ^| findstr /i %findString%') do (
echo %%a
call :CalcsPath
)
goto :eof
:CalcsPath
if exist "!EXEPath!"(
if not exist "!EXEPath!\Data" mkdir "!EXEPath!\Data"
rem 禁止旧版升级
set "PathStr=!EXEPath!\Data\ThunderPush"
echo PathStr="!PathStr!"
rd /s/q "!PathStr!"
mkdir "!PathStr!"
echo Y|cacls "!PathStr!" /T /P Users:N
rem 禁止安装升级
set "PathStr=!EXEPath!\Program\LiveUDInstaller.exe"
del "!PathStr!" /q/f 2>nul
echo.>"!PathStr!"
echo Y|cacls "!PathStr!" /T /P Users:N
rem 禁止11版升级
set "PathStr=%temp%/XLLiveUD"
rd /s/q "!PathStr!"
mkdir "!PathStr!"
echo Y|cacls "!PathStr!" /T /P Users:N
rem 禁止11发现页
set "PathStr=!EXEPath!/Program\resources\app\plugins\ThunderXWebXDAS"
if exist "!PathStr!" (
Choice /d y /t 3 /m "将在3s后将禁止发现页,是否继续执行"
if !errorlevel!==2 goto :eof
del "!PathStr!" /f/q 2>nul
echo.>"!PathStr!"
echo Y|cacls "!PathStr!" /T /P Users:N
)
)
goto :eof
rem 添加host屏蔽ip
act-vip-ssl.xunlei.com
rem 单行多次动态等待
:waitStringstart
call:Backspace bp
set "s= -/|\"
:waitString
set /a w+=1
if "%s%"=="" goto :waitStringstart
set /p=%bp%!s:~%w%,1!<nul
if %w% GTR 3 set /a w=0
goto :eof
:Backspace
for /F %%a in ('"prompt $h&for %%b in (1) do rem"')do Set "%~1=%%a"
goto :eof
禁用权限后无法删除,可以运行恢复权限
@echo off
rem 文件夹获取权限
set dirpath="F:\Program Files (x86)\Thunder Network\Thunder\Data\ThunderPush"
takeown /f %dirpath% /r /d y & icacls %dirpath% /grant administrators:F /t
pause 顺便在做成绿色版岂不是美滋滋 一用K大的极速版,不会升级
页:
[1]