楼主: n0b0dy
收起左侧

[卡巴教程] 自动激活 x 自动更新订阅 x 如何更优雅地使用测试版激活码

  [复制链接]
n0b0dy
 楼主| 发表于 2025-9-21 02:33:32 | 显示全部楼层
微微的笑 发表于 2025-9-15 10:55
大佬,问一下如果使用计划任务的话,是不是不能更新卡巴版本?

不是
你需要手动卸载旧版本,再用批处理安装新版本
n0b0dy
 楼主| 发表于 2025-9-21 02:34:18 | 显示全部楼层
qq150234 发表于 2025-8-14 17:25
可以在里面登陆卡巴账号吗

可以
微微的笑
发表于 2025-9-22 10:08:09 | 显示全部楼层
n0b0dy 发表于 2025-9-21 02:33
不是
你需要手动卸载旧版本,再用批处理安装新版本

手动卸载卡巴是不是还要手动去删除计划任务,不然要任务要重复
n0b0dy
 楼主| 发表于 2025-9-23 02:17:33 | 显示全部楼层
微微的笑 发表于 2025-9-22 10:08
手动卸载卡巴是不是还要手动去删除计划任务,不然要任务要重复

不需要,批处理会帮你搞定
qubn001
发表于 2025-9-23 09:06:57 | 显示全部楼层
感觉好像失效了
Pp^_^
发表于 2025-9-23 20:14:25 | 显示全部楼层
21.22版失效了,需要输入激活码了!
libo_libo2008
发表于 2025-9-26 19:41:36 | 显示全部楼层
失效了吗,试了几次都安装的标准版,而且要输入激活码
n0b0dy
 楼主| 发表于 2025-9-27 03:33:31 | 显示全部楼层
本帖最后由 n0b0dy 于 2025-9-27 03:35 编辑

# Changelog

## 2025-09-26

### Changed
- 以低 CPU 优先级运行 startup.exe,希望能避免破坏应用程序完整性
   (我觉得还没失效,如果你觉得失效了,就不要用了)

## 2025-05-26

### Changed
- 优化了计划任务的运行条件:
  - 在使用电池的情况下也可运行计划任务
  - 仅在连接网络时运行计划任务
  - 若错过预定运行时间,计划任务将在系统下一次登录后补运行

  1. @echo off
  2. REM Set the current directory
  3. cd /d "%~dp0"

  4. REM Step 1: Get admin rights
  5. NET FILE 1>NUL 2>NUL
  6. if '%errorlevel%' == '0' ( goto :gotAdmin ) else ( powershell Start-Process '%0' -Verb runAs & exit /B )

  7. :gotAdmin
  8. REM Step 2: Get version information from startup.exe
  9. setlocal EnableDelayedExpansion
  10. for /f "usebackq delims=" %%i in (`powershell -command "& {(Get-Item '.\startup.exe').VersionInfo.ProductVersion}"`) do (
  11.     set "fullversion=%%i"
  12. )
  13. REM Extract just the first two segments (e.g., 21.20 from 21.20.8.505)
  14. for /f "tokens=1,2 delims=." %%a in ("!fullversion!") do (
  15.     set "majorversion=%%a.%%b"
  16. )
  17. echo Detected Kaspersky version: !majorversion!

  18. REM Step 3: Ask user to choose
  19. :autoRenewal
  20. echo.
  21. echo Would you like to enable automatic license renewal?
  22. set /p renewal="Enter your choice (y/n): "
  23. if "%renewal%"=="y" (
  24.     goto :editionSelection
  25. ) else if "%renewal%"=="n" (
  26.     goto :installation
  27. ) else (
  28.     echo Invalid choice.
  29.     goto :autoRenewal
  30. )

  31. :editionSelection
  32. echo.
  33. echo Please select Kaspersky edition:
  34. echo 1. Standard
  35. echo 2. Plus
  36. echo 3. Premium
  37. echo.
  38. set /p edition="Enter your choice (1-3): "

  39. if "%edition%"=="1" (
  40.     set "editionName=Kaspersky Standard"
  41.     set "licenseKey=GAJPU-UTD18-3B2JJ-62CQ2"
  42. ) else if "%edition%"=="2" (
  43.     set "editionName=Kaspersky Plus"
  44.     set "licenseKey=GE86F-9WQRM-KK5PG-1ZE2W"
  45. ) else if "%edition%"=="3" (
  46.     set "editionName=Kaspersky Premium"
  47.     set "licenseKey=5AP55-UFAT1-QUMNN-7CUDZ"
  48. ) else (
  49.     echo Invalid choice.
  50.     goto :editionSelection
  51. )

  52. echo.
  53. echo Selected edition: %editionName%

  54. :installation
  55. REM Step 4: Run "startup.exe" without self protection
  56. echo.
  57. echo Installing Kaspersky with self protection disabled...
  58. start "" /low startup.exe /pSelfProtection=0

  59. REM Step 5: Monitor registry key and modify values during installation
  60. echo.
  61. echo Monitoring and updating registry values...
  62. :checkRegistry
  63. REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\KasperskyLab\AVP%majorversion%\environment" /v "ProductStatus" >nul 2>&1
  64. if %errorlevel% equ 0 (
  65.     echo Registry found, applying modifications...
  66.     REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\KasperskyLab\AVP%majorversion%\environment" /v "ProductStatus" /t REG_SZ /d "" /f >nul 2>&1
  67.     echo Registry modifications completed.
  68.     goto :setupTask
  69. ) else (
  70.     goto :checkRegistry
  71. )

  72. :setupTask
  73. if "%renewal%"=="n" (
  74.     goto :done
  75. )

  76. REM Step 6: Manage scheduled task for license renewal
  77. :search
  78. REM Clear previous value
  79. set "avp="

  80. REM Search for avp.com under Kaspersky Lab directory
  81. for /f "delims=" %%A in ('dir /b /s /a-d "C:\Program Files (x86)\Kaspersky Lab\avp.com" 2^>nul') do (
  82.     set "avp=%%A"
  83. )

  84. if not defined avp (
  85.     timeout /t 5 >nul
  86.     goto :search
  87. )

  88. echo.
  89. echo Found avp.com at: %avp%
  90. echo Creating new license renewal task to run every 28 days...

  91. set "taskname=Kaspersky License Renewal"
  92. set "xmlfile=%TEMP%\task.xml"

  93. REM Creating new license renewal task...
  94. schtasks /create /tn "%taskname%" /tr "\"%avp%\" LICENSE /add %licenseKey%" /sc DAILY /mo 28 /f >nul 2>&1

  95. REM Exporting the task to XML...
  96. schtasks /query /tn "%taskname%" /xml > "%xmlfile%"

  97. REM Modifying XML settings...

  98. REM Use PowerShell to update XML
  99. powershell -Command ^
  100.   "$xml = [xml](Get-Content '%xmlfile%');" ^
  101.   "$nsmgr = New-Object System.Xml.XmlNamespaceManager($xml.NameTable);" ^
  102.   "$nsmgr.AddNamespace('ns', $xml.DocumentElement.NamespaceURI);" ^
  103.   "$settings = $xml.SelectSingleNode('//ns:Settings', $nsmgr);" ^
  104.   "if (-not $settings) { $settings = $xml.CreateElement('Settings', $xml.DocumentElement.NamespaceURI); $xml.Task.AppendChild($settings) | Out-Null };" ^

  105.   "if (-not $settings.SelectSingleNode('ns:StartWhenAvailable', $nsmgr)) {" ^
  106.     "$node = $xml.CreateElement('StartWhenAvailable', $xml.DocumentElement.NamespaceURI);" ^
  107.     "$node.InnerText = 'true'; $settings.AppendChild($node) | Out-Null" ^
  108.   "} else { $settings.SelectSingleNode('ns:StartWhenAvailable', $nsmgr).InnerText = 'true' };" ^

  109.   "if (-not $settings.SelectSingleNode('ns:DisallowStartIfOnBatteries', $nsmgr)) {" ^
  110.     "$node = $xml.CreateElement('DisallowStartIfOnBatteries', $xml.DocumentElement.NamespaceURI);" ^
  111.     "$node.InnerText = 'false'; $settings.AppendChild($node) | Out-Null" ^
  112.   "} else { $settings.SelectSingleNode('ns:DisallowStartIfOnBatteries', $nsmgr).InnerText = 'false' };" ^

  113.   "if (-not $settings.SelectSingleNode('ns:RunOnlyIfNetworkAvailable', $nsmgr)) {" ^
  114.     "$node = $xml.CreateElement('RunOnlyIfNetworkAvailable', $xml.DocumentElement.NamespaceURI);" ^
  115.     "$node.InnerText = 'true'; $settings.AppendChild($node) | Out-Null" ^
  116.   "} else { $settings.SelectSingleNode('ns:RunOnlyIfNetworkAvailable', $nsmgr).InnerText = 'true' };" ^

  117.   "$xml.Save('%xmlfile%')" >nul 2>&1

  118. REM Re-importing modified task...
  119. schtasks /delete /tn "%taskname%" /f >nul 2>&1
  120. schtasks /create /tn "%taskname%" /xml "%xmlfile%" /f >nul 2>&1

  121. del "%xmlfile%" 2>nul

  122. echo Task updated successfully.
  123. echo.
  124. echo Activating %editionName%...

  125. :checkStartup
  126. REM Check if avp.exe is running
  127. tasklist | find /i "avp.exe" >nul 2>&1
  128. if %errorlevel% neq 0 (
  129.     timeout /t 5 >nul 2>&1
  130.     goto :checkStartup
  131. )

  132. schtasks /run /tn "%taskname%"

  133. echo.
  134. echo Selected edition: %editionName%
  135. echo Using version: %majorversion%
  136. echo License key: %licenseKey%

  137. :done
  138. echo Process completed successfully.
  139. endlocal
  140. timeout /t 10
复制代码
clampeve
发表于 2025-9-28 10:56:57 | 显示全部楼层
感谢大神分享,21.22版本正常激活了
INK·
发表于 2025-9-28 14:39:28 | 显示全部楼层
已安装,感谢大佬
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2025-10-27 04:53 , Processed in 0.113496 second(s), 15 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

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