发布,原创批量安装补丁工具(不需要手工添加文件名)
批量安装Windows补丁的方法已经有了,Google一下就可以了。
但目前的方法需要手工把补丁的文件名放到批处理中。
我改写了一下,只要把该脚本与补丁放到同一目录就可以了。
原理不说了,直接看代码吧。
最后的qchain用来调整文件版本,安装1个以上补丁而不重启时必须运行,确保最新的文件被安装。详情和下载的方法google一下吧。
补丁的下载方法也google一下吧,比如可以通过365安全卫士下载。
该脚本在WindowsXP下测试成功。
@echo off
setlocal
set ATHTOFIXES=.
rem Copyright:
rem Zhaolei, 2007-4-16 (Please do not modify it, May God Bless You.)
rem Manual:
rem Put all windows updates and qchain and this batch into same directory, as following, and run this batch.
rem WindowsXP-KB890046-x86-CHS.exe
rem WindowsXP-KB899589-x86-CHS.exe
rem WindowsXP-KB911567-x86-CHS.exe
rem WindowsXP-KB918899-x86-CHS.exe
rem WindowsXP-KB920214-x86-CHS.exe
rem WindowsXP-KB921398-x86-CHS.exe
rem WindowsXP-KB921883-x86-CHS.exe
rem WindowsXP-KB922616-x86-CHS.exe
rem WindowsXP-KB922760-x86-CHS.exe
rem WindowsXP-KB925454-x86-CHS.exe
rem WindowsXP-KB925486-x86-CHS.exe
rem qchain.exe
rem SETUP_HOTFIX.BAT
rem For developer:
rem Do not use "start" command, because it will cause several hotfix installed at same time,
rem and only one hotfix successed(other hotfix will error and exit)
rem We use /passive mode instead of /quiet mode to make user see install progress.
rem We use /nobackup to save disk space.(Uninstall impossible)
for /F %%F in ('DIR %ATHTOFIXES%\WindowsXP-KB??????-x86-CHS.exe /A-D /B /ON /W') do echo Installing %%F & %%F /passive /norestart /nobackup & if ERRORLEVEL 1 (echo Failed) else (echo Successed)
echo Executing qchain
%ATHTOFIXES%\qchain.exe
if ERRORLEVEL 1 (echo Failed) else (echo Successed)
echo Hotfix install complished
pause