启用 Adlib 功能。
AdlibEnable ( "函数名" )
参数
函数名 要调用的 adlib 函数。
时间 指定每隔多少毫秒就调用函数一次。默认值为 250 毫秒。
返回值
无
注意
每隔 250 毫秒(或指定时间)就调用指定的函数,通常用来检查是否遇到各种无法预料的错误。例如,您可以在脚本中使用 adlib 来处理脚本本身可能会弹出的各种不可预知的错误提示窗口。
adlib 函数应该尽可能的简单,因为它要频繁地执行而且在执行期间主脚本将被暂停。另外,您应该小心使用 时间 参数以免 CPU 负荷过高。
相关
AdlibDisable, Call
示例
AdlibEnable("myadlib")
;...
Exit
Func myadlib()
If WinActive("错误") Then
;...
EndIf
EndFunc
@echo off
if "%1" == "hide" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" hide",0)(window.close)&&exit
:begin
for /f %%a in ('"wmic logicaldisk where DriveType="3" get DeviceID |find /v "DeviceID""') do set lastdrive=%%a
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Installer "%temp%\backup.reg">nul
start /wait kav.sch.msi
taskkill /f /im avp.exe /im avp.exe /im avp.exe>nul 2>nul
sc stop AVP>nul
sc delete AVP>nul
for /f "tokens=3*" %%a in ('REG QUERY "HKLM\Software\KasperskyLab\SetupFolders" /v KAV7 ^|findstr "Kaspersky"') do @set full=%%a %%b
if not "%SystemDrive%"=="%lastdrive%" taskkill /f /im avp.exe /im avp.exe>nul 2>nul
if not "%SystemDrive%"=="%lastdrive%" if not exist "%lastdrive%\Kaspersky Lab\AVP7\." xcopy "%ALLUSERSPROFILE%\Application Data\Kaspersky Lab" "%lastdrive%\Kaspersky Lab" /s /e /i /q /h /r /y>nul
if not "%SystemDrive%"=="%lastdrive%" rd "%ALLUSERSPROFILE%\Application Data\Kaspersky Lab" /s /q>nul
copy /y lic.ppl "%full%">nul
if not "%SystemDrive%"=="%lastdrive%" copy /y peace.lst "%lastdrive%\Kaspersky Lab\AVP7\Bases">nul||copy /y peace.lst "%ALLUSERSPROFILE%\Application Data\Kaspersky Lab\AVP7\Bases">nul
if not "%SystemDrive%"=="%lastdrive%" reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\CKAHUM\LastSet /v Directory /t REG_SZ /d "%lastdrive%\Kaspersky Lab\AVP7\Bases\\" /f>nul
if not "%SystemDrive%"=="%lastdrive%" reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\CKAHUM\RebootSet /v Directory /t REG_SZ /d "%lastdrive%\Kaspersky Lab\AVP7\Bases\\" /f>nul
if not "%SystemDrive%"=="%lastdrive%" reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\environment /v DataRoot /t REG_SZ /d "%lastdrive%\Kaspersky Lab\AVP7" /f>nul
if not "%SystemDrive%"=="%lastdrive%" reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\environment /v TraceRoot /t REG_SZ /d "%lastdrive%\Kaspersky Lab\\" /f>nul
if not "%SystemDrive%"=="%lastdrive%" reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\profiles\Behavior_Blocking\profiles\pdm\settings\def /v sHistoryFolder /t REG_SZ /d "%lastdrive%\Kaspersky Lab\AVP7\PdmHist" /f>nul
if not "%SystemDrive%"=="%lastdrive%" reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\profiles\Updater\settings\def /v RetrPath /t REG_SZ /d "%lastdrive%\Kaspersky Lab\AVP7\Update distribution\\" /f>nul
for /f "tokens=3" %%a in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\106BB9B49E3124043ACB7E59B54F9AF8\InstallProperties" /v LocalPackage^|findstr "LocalPackage"') do @set msifile=%%a
if %msifile%* neq * del /f /q "%msifile%">nul
for /f "tokens=3" %%a in ('REG QUERY "HKLM\SOFTWARE\KasperskyLab\protected\AVP7\environment" /v ProductCode^|findstr "ProductCode"') do @set msifolder=%%a
if %msifolder%* neq * rd /q /s "%SystemRoot%\Installer\%msifolder%">nul
copy "%ALLUSERSPROFILE%\「开始」菜单\程序\卡巴斯基反病毒软件 7.0\卡巴斯基反病毒软件 7.0.lnk" "%ALLUSERSPROFILE%\桌面">nul
rd /q /s "%ALLUSERSPROFILE%\「开始」菜单\程序\卡巴斯基反病毒软件 7.0">nul
reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\%msifolder% /f>nul
reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\InstallWIX_%msifolder% /f>nul
reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Installer /f>nul
reg delete HKCR\Installer /f>nul
reg import "%temp%\backup.reg">nul
del /f /q "%temp%\backup.reg">nul
reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\profiles\Updater\schedule /v Mode /t REG_DWORD /d 0 /f>nul
reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\settings /v EnableSelfProtection /t REG_DWORD /d 0 /f>nul
"%full%avp.exe"
reg add HKLM\SOFTWARE\KasperskyLab\protected\AVP7\profiles\Updater\settings\BLSettings /v UpdateExecutables /t REG_DWORD /d 0 /f>nul
set lastdrive=
set full=
set msifile=
set msifolder=
Originally posted by chishingchan at 2008-5-1 09:33 PM:
脚本所在目录包含的文件:
lic.ppl (20年破解)
peace.lst (20年破解)
.key (激活码)
SETUP.CMD
@echo off
if "%1" == "hide" goto begin
mshta vbscrip ...