中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-21 14:01
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » for 安装winxp补丁怎样才能实现选择安装 查看 741 回复 2
楼 主 for 安装winxp补丁怎样才能实现选择安装 发表于 2007-06-21 21:07 ·  中国 河南 许昌 长葛市 联通
新手上路
积分 16
发帖 5
注册 2007-06-15 18:59
19年会员
UID 91441
性别 男
状态 离线
下载了好多补丁用for命令安装系统补丁怎样才能实现安装过程中不安装以前已经安装过的补丁?请大家指教~~
2 发表于 2007-06-23 20:59 ·  中国 河南 漯河 联通
新手上路
积分 16
发帖 5
注册 2007-06-15 18:59
19年会员
UID 91441
性别 男
状态 离线
难道没人知道??还是问题太菜了~~期待高人!!
3 发表于 2007-06-27 00:48 ·  中国 广东 深圳 龙岗区 电信
新手上路
积分 12
发帖 6
注册 2006-05-31 13:10
20年会员
UID 56313
性别 男
状态 离线
仅供参数,补丁的文件名如:
WindowsXP-KB886185-x86-chs.exe
WindowsXP-KB904706-v2-x86-CHS.exe
WindowsMedia9-KB917734-x86-CHS.exe

仍有点问题:
WindowsMedia9-KB911565-x86-CHS.exe
WindowsMedia-KB911564-x86-CHS.exe
这两个补丁不能测出来,每次都会安装。

继续找更好的方法。

@echo off
if "%1"=="" goto _s
if "%1"=="t" goto _t
if "%1"=="r" goto _r

:_s
systeminfo >c:\systeminfo.log
dir *.exe /a/b/on >c:\list.log
set /a total=0
set /a current=0

for /f %%i in (c:\list.log) do call %0 t

for /f "delims=- tokens=2" %%j in (c:\list.log) do call %0 r %%j

set total=
set current=
del c:\systeminfo.log /f
del c:\list.log /f
echo 安装补丁完成!!
goto _end

:_t
set /a total=%total%+1
goto _end

:_r
for %%k in (*%2*.exe) do set ccmd=%%k

set /a current=%current%+1
echo 当前完成度:%current%/%total%
echo 正在安装:%ccmd%...

type c:\systeminfo.log | find /i "%2"
if %errorlevel%==1 %ccmd% /u /q /z /n

:_end
论坛跳转: