@Echo Off
PUSHD %Cd%
Set AVP=avp.exe
If Not Exist %AVP% Exit
Set WMIC=%WinDir%\system32\wbem\wmic.exe
If Not Exist %WMIC% Goto NoWMI
Set TP=%Cd%
Set TP=%TP:\=\\%
Set CHK=%TEMP%\CHK_%Random%.TMP
wmic quit
>%CHK% wmic datafile where name="%TP%\\%AVP%" get Version
If Not "%Errorlevel%"=="0" Goto NoWMI
For /F "delims=. tokens=1" %%i In ('TYPE "%CHK%"^|FIND "."') DO SET AVPVer=%%i
Del %CHK% /F /Q>NUL 2>NUL
Goto Next
:NoWMI
Set AVPVer=6
For %%i In (%AVP%) Do If %%~zi GTR 180000 Set AVPVer=7
Goto Next
:Next
regedit /s Set.reg
regsvr32 /s shellex.dll
Set AVP6=HKLM\SOFTWARE\KasperskyLab\AVP6&&Set AVP7=HKLM\SOFTWARE\KasperskyLab\protected\AVP7
REG ADD %AVP7%\environment /v DataRoot /t REG_SZ /d "%CD%" /f>NUL
REG ADD %AVP7%\environment /v ProductRoot /t REG_SZ /d "%CD%" /f>NUL
REG ADD %AVP7%\settings /v LoginImage /t REG_SZ /d "%CD%\Skin\images\lgnkav.png" /f>NUL
REG ADD %AVP7%\settings /v Ins_ProductPath /t REG_SZ /d "%CD%\\" /f>NUL
REG ADD HKLM\SOFTWARE\KasperskyLab\SetupFolders /v KAV7 /t REG_SZ /d "%CD%\\" /f>NUL
REG ADD %AVP6%\environment /v DataRoot /t REG_SZ /d "%CD%" /f>NUL
REG ADD %AVP6%\settings /v LoginImage /t REG_SZ /d "%CD%\Skin\images\kav_en.gif" /f>NUL
If Exist B: If Exist %Windir%\System32\PECMD.EXE Goto Set_KAVBase
:RunAVP
PECMD ENVI $TARGET_ROOT
start /wait avp.exe
regedit /s delavp.reg >nul 2>nul
If "%NoPJ%"=="Yes" Del "%BP%\Bases\peace.lst" /F /Q >NUL
Set Sys32=%WinDir%\System32
REG ADD HKCR\CLSID\{989D1DC0-B162-11D1-B6EC-D27DDCF9A923}\InProcServer32 /ve /t REG_SZ /d "%Sys32%\msxml3.dll" /f>NUL
REG ADD HKCR\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32 /ve /t REG_SZ /d "%Sys32%\vbscript.dll" /f>NUL
REG ADD HKCR\CLSID\{B54F3742-5B07-11cf-A4B0-00AA004A55E8}\InProcServer32 /ve /t REG_SZ /d "%Sys32%\vbscript.dll" /f>NUL
REG ADD HKCR\CLSID\{B54F3743-5B07-11cf-A4B0-00AA004A55E8}\InProcServer32 /ve /t REG_SZ /d "%Sys32%\vbscript.dll" /f>NUL
REG ADD HKCR\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\InProcServer32 /ve /t REG_SZ /d "%Sys32%\jscript.dll" /f>NUL
REG ADD HKCR\CLSID\{f414c261-6ac0-11cf-b6d1-00aa00bbbb58}\InProcServer32 /ve /t REG_SZ /d "%Sys32%\jscript.dll" /f>NUL
REG ADD HKCR\CLSID\{f414c262-6ac0-11cf-b6d1-00aa00bbbb58}\InProcServer32 /ve /t REG_SZ /d "%Sys32%\jscript.dll" /f>NUL
REG DELETE HKCR\CLSID\{989D1DC0-B162-11D1-B6EC-D27DDCF9A923}\InProcServer32 /v OriginalDll /f>NUL 2>NUL
REG DELETE HKCR\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InProcServer32 /v OriginalDll /f>NUL 2>NUL
REG DELETE HKCR\CLSID\{B54F3742-5B07-11cf-A4B0-00AA004A55E8}\InProcServer32 /v OriginalDll /f>NUL 2>NUL
REG DELETE HKCR\CLSID\{B54F3743-5B07-11cf-A4B0-00AA004A55E8}\InProcServer32 /v OriginalDll /f>NUL 2>NUL
REG DELETE HKCR\CLSID\{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}\InProcServer32 /v OriginalDll /f>NUL 2>NUL
REG DELETE HKCR\CLSID\{f414c261-6ac0-11cf-b6d1-00aa00bbbb58}\InProcServer32 /v OriginalDll /f>NUL 2>NUL
REG DELETE HKCR\CLSID\{f414c262-6ac0-11cf-b6d1-00aa00bbbb58}\InProcServer32 /v OriginalDll /f>NUL 2>NUL
Exit
:Set_KAVBase
Set CHKBP=%TEMP%\CHK_%Random%.TMP
PECMD BROW $您可以选用硬盘上安装的卡巴斯基 6.0 版本病毒库,以便 WinPE 的卡巴使用最新病毒库。请选路径例如:C:\Program Files\AVP6,点取消则使用默认病毒库。
For /F "skip=2 tokens=2*" %%i In ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v TARGET_ROOT') DO SET BP=%%j
Set BPC=%BP:\=\\%
If Not Exist "%BP%\Bases\avp_x.set" (
PECMD MESS 未设置或没有找到您选择的病毒库路径!\n \n将使用默认的 WinPE 自带病毒库。@使用默认病毒库#OK
Goto RunAVP
)
If Not Exist %WMIC% Goto NoWMIC
>%CHKBP% wmic datafile where name="%BPC%\\%AVP%" get Version
If Not "%Errorlevel%"=="0" Goto NoWMIC
For /F "delims=. tokens=1" %%i In ('TYPE "%CHKBP%"^|FIND "."') DO SET BPVer=%%i
Del %CHKBP% /F /Q>NUL 2>NUL
Goto CompVer
:NoWMIC
Set BPVer=6
For %%i In ("%BP%\%AVP%") Do If %%~zi GTR 180000 Set BPVer=7
:CompVer
If "%BPVer%"=="%AVPVer%" (
PECMD REGI HKLM\SOFTWARE\KasperskyLab\AVP6\environment\Bases=%BP%\Bases
PECMD REGI HKLM\SOFTWARE\KasperskyLab\protected\AVP7\environment\Bases=%BP%\Bases
PECMD MESS 成功寻找到您选择的病毒库!\n \n@使用外挂病毒库#OK
If Exist "%CD%\Bases\peace.lst" If Not Exist "%BP%\Bases\peace.lst" Set NoPJ=Yes&&Copy .\Bases\peace.lst "%BP%\Bases" /Y >NUL
) Else (
PECMD MESS 您选择的卡巴斯基病毒库跟当前版本不一致!\n \n将使用默认的 WinPE 自带病毒库。@使用默认病毒库#OK
)
Goto RunAVP
5.42 KB, 下载次数: 1460, 下载积分: 无忧币 -2
欢迎光临 无忧启动论坛 (http://wuyou.net./) | Powered by Discuz! X3.3 |