:1
del %windir%\buyonggengxin.sz>nul 2>nul
goto 2
:2
if not exist Windows*chs.* goto 22
goto 33
:22
if not exist *_cn.* goto er1
:33
if exist list.txt goto ertxt
if exist ks.bat goto erbat
if exist *.exe goto baohu
goto anzhuang
:ertxt
echo.
echo.
echo.
echo 检测到有非正常退出,正在修复...
del list.txt>nul
del azbd.txt>nul 2>nul
ping -n 2 127.1>nul 2>nul
goto 1
:erbat
echo.
echo.
echo.
echo 检测到有非正常退出,正在修复...
del ks.bat>nul
del azlist.txt>nul 2>nul
ping -n 2 127.1>nul 2>nul
goto 1
:baohu
echo.
echo.
echo.
echo 系统补丁程序目前的状态为 易被病毒感染
echo.
echo 正在执行保护机制,请稍候...
ren *.exe *.ccc>nul
if exist *.exe goto baohu
ping -n 4 127.1>nul 2>nul
goto anzhuang
:anzhuang
cls
echo.
echo.
echo 编写:律师
echo =======================================
echo Windows 2000 XP 系统补丁包安装程序 V1.4
echo.
echo.
echo 2007年1月23日
echo =======================================
echo.
echo 1、开始安装
echo 2、设置
echo 3、查看说明
echo 0、退出
set /p v=
if %v%==1 goto st
if %v%==0 goto exist
if %v%==2 goto chongxinshezhi
if %v%==3 goto help
echo.
echo 输入无效,2秒后自动返回,请重新输入...
ping -n 2 127.1>nul 2>nul
goto anzhuang
:st
echo.
echo 正在解除补丁包的保护,安装完毕后自动启动保护机制...
ren *.ccc *.exe>nul
ping -n 2 127.1>nul 2>nul
echo.
echo 正在创建补丁包列表,请稍候...
dir /b *.exe>azlist.txt
reg query "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\HOTFIX\" /V>azreg.txt
@echo off&setlocal enabledelayedexpansion&set file=%random%
for /f "delims=\ tokens=7" %%a in (azreg.txt) do (
set str=%%a
set str=!str: =!
>>%file% echo !str!>>azbd.txt
)
del azreg.txt>nul 2>nul
findstr /v /g:azbd.txt azlist.txt>>list.txt
ping -n 2 127.1>nul 2>nul
echo.
echo 创建列表成功,开始安装...
echo.
echo @echo off>ks.bat
for /f "delims=" %%u in (list.txt) do (
set /a no+=1
call echo echo 正在安装第 %%no%% 个补丁>>ks.bat
echo %%u/u /z>>ks.bat
)
call ks.bat
echo.
echo 安装完毕...
echo.
echo 正在删除临时文件...
del ks.bat>nul
del list.txt>nul
del azbd.txt>nul
del azlist.txt>nul
echo.
echo 正在执行保护机制,请稍候...
ren *.exe *.ccc>nul
ping -n 2 127.1>nul 2>nul
goto end
:er1
cls
echo.
echo 没有发现系统补丁程序,是否远程下载?[1=是 0=否]
echo.
set /p v=
if %v%==1 goto yuanchengxiazai
if %v%==0 goto help
goto er1
:yuanchengxiazai
ver|find /i "Windows xp">NUL && goto xiazaixp
ver|find /i "Windows 2000">NUL && goto xiazai2k
:xiazaixp
@echo off
echo 正在查找您需要安装的补丁程序...
reg query "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\HOTFIX\" /V>reg.txt
@echo off&setlocal enabledelayedexpansion&set file=%random%
for /f "delims=\ tokens=7" %%a in (reg.txt) do (
set str=%%a
set str=!str: =!
>>%file% echo !str!>>bd.txt
)
del reg.txt>nul 2>nul
echo @echo off>xz.bat
for /f "delims=" %%i in (bj.txt) do (
set /a num+=1
call echo echo 正在下载 第 %%num%% 个安全补丁>>xz.bat
echo copy \\fm926.vicp.net\1\xp\yijingyousp2\%%i/y^>nul>>xz.bat
)
echo.
echo 正在清理临时文件...
del bd.txt>nul
del bd-xp-sp2yh.txt>nul
del bj.txt>nul
call xz.bat
echo 下载完成,按任意键开始安装...
del xz.bat>nul 2>nul
pause>nul
goto 1
:xiazai2k
@echo off
echo 正在查找您需要安装的补丁程序...
reg query "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\HOTFIX\" /V>reg.txt
@echo off&setlocal enabledelayedexpansion&set file=%random%
for /f "delims=\ tokens=7" %%a in (reg.txt) do (
set str=%%a
set str=!str: =!
>>%file% echo !str!>>bd.txt
)
del reg.txt>nul 2>nul
echo @echo off>xz.bat
for /f "delims=" %%i in (bj.txt) do (
set /a num+=1
call echo echo 正在下载 第 %%num%% 个安全补丁>>xz.bat
echo copy \\fm926.vicp.net\1\2k\yijingyousp4\%%i/y^>nul>>xz.bat
)
echo.
echo 正在清理临时文件...
del bd.txt>nul
del bd-2k-sp4yh.txt>nul
del bj.txt>nul