Board logo

标题: for 安装winxp补丁怎样才能实现选择安装 [打印本页]

作者: wwggd     时间: 2007-6-21 21:07    标题: for 安装winxp补丁怎样才能实现选择安装

下载了好多补丁用for命令安装系统补丁怎样才能实现安装过程中不安装以前已经安装过的补丁?请大家指教~~
作者: wwggd     时间: 2007-6-23 20:59
难道没人知道??还是问题太菜了~~期待高人!!
作者: andyli     时间: 2007-6-27 00:48
仅供参数,补丁的文件名如:
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