# Changelog
## 2026-07-26
### Changed
- 修改安装后的自动激活逻辑,彻底解决安装过程中计划任务启动过早导致的真激活失败和计划任务启动过迟导致的伪激活失败问题
- 自动更新订阅的间隔修改为 60 天
- 支持从 UNC 路径安装
## 2025-09-26
### Changed
- 以低 CPU 优先级运行 startup.exe,希望能避免破坏应用程序完整性
## 2025-05-26
### Changed
- 优化了计划任务的运行条件:
- 在使用电池的情况下也可运行计划任务
- 仅在连接网络时运行计划任务
- 若错过预定运行时间,计划任务将在系统下一次登录后补运行
# FAQ
- Q: 失效了?
A: 并没有
- Q: 是否可以开启自我保护?
A: 建议开启
- Q: 是否支持 Win 7?
A: 不知道
- Q: 为什么“应用程序的完整性已被破坏”,如何解决?
A: 卸载,重试
- Q: 如何升级到新版本?
A: 手动卸载当前版本,再用批处理安装新版本
- Q: 如何第一时间收到补丁?
A: 删除第 75 行中的 “@REM ”
- @echo off
- REM Set the current directory (UNC-path compatible)
- pushd "%~dp0" 2>nul || pushd "%TEMP%"
- REM Step 1: Get admin rights
- NET FILE 1>NUL 2>NUL
- if '%errorlevel%' == '0' ( goto :gotAdmin ) else ( powershell Start-Process '%0' -Verb runAs & exit /B )
- :gotAdmin
- REM Step 2: Get version information from startup.exe
- setlocal EnableDelayedExpansion
- for /f "usebackq delims=" %%i in (`powershell -command "& {(Get-Item '%~dp0startup.exe').VersionInfo.ProductVersion}"`) do (
- set "fullversion=%%i"
- )
- REM Extract just the first two segments (e.g., 21.20 from 21.20.8.505)
- for /f "tokens=1,2 delims=." %%a in ("!fullversion!") do (
- set "majorversion=%%a.%%b"
- )
- echo Detected Kaspersky version: !majorversion!
- REM Step 3: Ask user to choose
- :autoRenewal
- echo.
- echo Would you like to enable automatic license renewal?
- set /p renewal="Enter your choice (y/n): "
- if "%renewal%"=="y" (
- goto :editionSelection
- ) else if "%renewal%"=="n" (
- goto :installation
- ) else (
- echo Invalid choice.
- goto :autoRenewal
- )
- :editionSelection
- echo.
- echo Please select Kaspersky edition:
- echo 1. Standard
- echo 2. Plus
- echo 3. Premium
- echo.
- set /p edition="Enter your choice (1-3): "
- if "%edition%"=="1" (
- set "editionName=Kaspersky Standard"
- set "licenseKey=GAJPU-UTD18-3B2JJ-62CQ2"
- ) else if "%edition%"=="2" (
- set "editionName=Kaspersky Plus"
- set "licenseKey=GE86F-9WQRM-KK5PG-1ZE2W"
- ) else if "%edition%"=="3" (
- set "editionName=Kaspersky Premium"
- set "licenseKey=5AP55-UFAT1-QUMNN-7CUDZ"
- ) else (
- echo Invalid choice.
- goto :editionSelection
- )
- echo.
- echo Selected edition: %editionName%
- :installation
- REM Step 4: Run "startup.exe" without self protection
- echo.
- echo Installing Kaspersky with self protection disabled...
- start "" /low "%~dp0startup.exe" /pSELFPROTECTION=0 /pACTIVATIONCODE=%licenseKey%
- REM Step 5: Monitor registry key and modify values during installation
- echo.
- echo Monitoring and updating registry values...
- :checkRegistry
- REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\KasperskyLab\AVP%majorversion%\environment" /v "ProductStatus" >nul 2>&1
- if %errorlevel% equ 0 (
- echo Registry found, applying modifications...
- REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\KasperskyLab\AVP%majorversion%\environment" /v "ProductStatus" /t REG_SZ /d "" /f >nul 2>&1
- @REM REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\KasperskyLab\AVP%majorversion%\environment" /v "UpdateTarget" /t REG_SZ /d "" /f >nul 2>&1
- echo Registry modifications completed.
- goto :setupTask
- ) else (
- goto :checkRegistry
- )
- :setupTask
- if "%renewal%"=="n" (
- goto :done
- )
- REM Step 6: Manage scheduled task for license renewal
- :search
- REM Clear previous value
- set "avp="
- REM Search for avp.com under Kaspersky Lab directory
- for /f "delims=" %%A in ('dir /b /s /a-d "C:\Program Files (x86)\Kaspersky Lab\avp.com" 2^>nul') do (
- set "avp=%%A"
- )
- if not defined avp (
- timeout /t 5 >nul
- goto :search
- )
- echo.
- echo Found avp.com at: %avp%
- echo Creating new license renewal task to run every 60 days...
- set "taskname=Kaspersky License Renewal"
- set "xmlfile=%TEMP%\task.xml"
- REM Creating new license renewal task...
- schtasks /create /tn "%taskname%" /tr "\"%avp%\" LICENSE /add %licenseKey%" /sc DAILY /mo 60 /f >nul 2>&1
- REM Exporting the task to XML...
- schtasks /query /tn "%taskname%" /xml > "%xmlfile%"
- REM Modifying XML settings...
- powershell -Command ^
- "$xml = [xml](Get-Content '%xmlfile%');" ^
- "$nsmgr = New-Object System.Xml.XmlNamespaceManager($xml.NameTable);" ^
- "$nsmgr.AddNamespace('ns', $xml.DocumentElement.NamespaceURI);" ^
- "$settings = $xml.SelectSingleNode('//ns:Settings', $nsmgr);" ^
- "if (-not $settings) { $settings = $xml.CreateElement('Settings', $xml.DocumentElement.NamespaceURI); $xml.Task.AppendChild($settings) | Out-Null };" ^
- "if (-not $settings.SelectSingleNode('ns:StartWhenAvailable', $nsmgr)) {" ^
- "$node = $xml.CreateElement('StartWhenAvailable', $xml.DocumentElement.NamespaceURI);" ^
- "$node.InnerText = 'true'; $settings.AppendChild($node) | Out-Null" ^
- "} else { $settings.SelectSingleNode('ns:StartWhenAvailable', $nsmgr).InnerText = 'true' };" ^
- "if (-not $settings.SelectSingleNode('ns:DisallowStartIfOnBatteries', $nsmgr)) {" ^
- "$node = $xml.CreateElement('DisallowStartIfOnBatteries', $xml.DocumentElement.NamespaceURI);" ^
- "$node.InnerText = 'false'; $settings.AppendChild($node) | Out-Null" ^
- "} else { $settings.SelectSingleNode('ns:DisallowStartIfOnBatteries', $nsmgr).InnerText = 'false' };" ^
- "if (-not $settings.SelectSingleNode('ns:RunOnlyIfNetworkAvailable', $nsmgr)) {" ^
- "$node = $xml.CreateElement('RunOnlyIfNetworkAvailable', $xml.DocumentElement.NamespaceURI);" ^
- "$node.InnerText = 'true'; $settings.AppendChild($node) | Out-Null" ^
- "} else { $settings.SelectSingleNode('ns:RunOnlyIfNetworkAvailable', $nsmgr).InnerText = 'true' };" ^
- "$xml.Save('%xmlfile%')" >nul 2>&1
- REM Re-importing modified task...
- schtasks /delete /tn "%taskname%" /f >nul 2>&1
- schtasks /create /tn "%taskname%" /xml "%xmlfile%" /f >nul 2>&1
- del "%xmlfile%" 2>nul
- echo Task updated successfully.
- echo.
- echo.
- echo Selected edition: %editionName%
- echo Using version: %majorversion%
- echo License key: %licenseKey%
- :done
- echo Process completed successfully.
- endlocal
- popd
- timeout /t 10
复制代码
|