吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2817|回复: 2
收起左侧

[其他转载] bat批处理禁止迅雷强制升级

[复制链接]
Sring65 发表于 2022-2-28 15:57
本帖最后由 Sring65 于 2022-4-22 11:11 编辑

更新了下,安装了抢先版本迅雷11版测试了下可以禁止、屏蔽发现页。
bat批处理禁止迅雷强制升级,迅雷急速版添加成功,其他版本未测试,
添加禁止访问权限权限Thunder Network\Thunder\Data\ThunderPush
下载脚本:迅雷极速版禁止更新.bat https://sring65.lanzouv.com/ij6e3014nblg


[Bash shell] 纯文本查看 复制代码
@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


禁用权限后无法删除,可以运行恢复权限
[Bash shell] 纯文本查看 复制代码
@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
QQ截图20220228153350.png

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

李佑辰 发表于 2022-2-28 15:58
顺便在做成绿色版岂不是美滋滋
咿呀咿呀呦 发表于 2022-2-28 17:34
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-29 01:33

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表