windows xp、win7、win8、office补丁批量安装程序

防跨省隐藏踪迹安全技术交流一般电脑技术交流,电脑操作系统,系统安全、网络安全交流。
  • Advertisement
高速翻墙
本贴由热心网友分享,或收集于网络,如侵犯您的权益,请及时联系我们删除。

windows xp、win7、win8、office补丁批量安装程序

帖子大话西游 » 2014-01-17 21:09

windows xp、win7、win8、office补丁批量安装程序 直连:

两个版本,一个可以安装系统补丁和office补丁,一个比较简单,只可以安装系统补丁。
测试使用,如果有问题请反馈。

使用方法:下面代码全选复制保存为hotfix.bat,补丁程序需要和这个批量安装程序放在同一个目录中。运行批量安装代码安装。理论上应该可以支持全版本的系统,xp、win7、win8的补丁都可以使用这个批量安装程序安装。

这个补丁安装批处理并没有提供补丁下载,补丁下载需要在论坛的其它补丁下载地址贴中自行下载,然后集中放置到本批量安装程序目录中运行。
不是所有的补丁都可以批量安装的,只有支持/quiet /norestart参数的补丁可以安装。
vc++ .net等目前是不支持的。这些补丁也不多,所以手动安装也可以。

目录中是系统补丁就放置系统补丁,是office目标那么就不要放置系统补丁,不要混放,目前没有排错设置,所以混放安装会错误。

在win8 32系统下面,安装补丁比较顺利,两个安装代码都没有问题,第一个安装代码由于有安装进度,感觉比较实用。这是因为安装补丁的时间比较长,所以有进度显示很方便。

代码: 全选
@echo off
PUSHD %~dp0
color 0a
mode con lines=22
title 系统补丁批量安装程序
If not exist *.exe (if not exist *.msu goto next2)
ver|find /i " 6." >nul||goto test
echo .>%windir%\test.txt
if exist %windir%\test.txt (
    del /f /q /a %windir%\test.txt>nul 2>nul
) else (
    cls
    echo.
    echo.
    echo    请右键◆以管理员身份运行◆本程序
    echo    按任意键退出...
    pause>nul
    exit
)
goto test2
:test
echo .>%windir%\test.txt
if exist %windir%\test.txt (
    del /f /q /a %windir%\test.txt>nul 2>nul
) else (
    cls
    echo.
    echo.
    echo    请以管理员身份登录电脑运行本程序
    echo    按任意键退出...
    pause>nul
    exit
)
:test2
Set L1=              ╭══════════════════╮
Set L2=              ║                  ║
Set L3=           ╭══┤       系统补丁批量安装程序       ├══╮
Set L4=           ║  ║                  ║  ║
Set L5=           ║  ╰══════════════════╯  ║
Set L6=           ║                        ║
Set L7=           ╟════════════════════════╢
Set L8=           ║     简单         安全         易用            ║
Set L9=           ╰────────────────────────╯
:begin
CLS
Echo.
Echo %L1%
Echo %L2%
Echo %L3%
Echo %L4%
Echo %L5%
Echo %L6%
Echo %L6%
Echo            ║  [1] 安装Windows补丁                  ║
Echo            ║  [2] 安装Office2003补丁                 ║
Echo            ║  [3] 安装Office2007、2010、2013补丁         ║
Echo            ║  [0] 退出本程序                  ║
Echo %L6%
Echo %L7%
Echo %L7%
Echo %L8%
Echo %L9%
echo.
echo.
set choice=
set /p choice=              选择要進行的操作 (1/2/3/0) ,然后按回车:
If "%choice%"=="" goto begin
If not "%choice%"=="" Set Choice=%Choice:~0,1%
If /i "%choice%"=="1" goto GO2
If /i "%choice%"=="2" goto GO3
If /i "%choice%"=="3" goto GO4
If /i "%choice%"=="0" exit
goto begin

:GO2
set str1=
ver | find "6." > NUL && (set XT=Windows NT6&set CX=Windows*-KB*.msu&set str=/quiet /norestart&set str1=wusa&goto TOP)
ver | find "5." > NUL && (set XT=Windows NT5&set CX=Windows*-KB*.exe&set str=/quiet /norestart&goto TOP)
goto TOP

:GO3
set XT=Office2003
set CX=*.exe
set str=/q
goto TOP

:GO4
set XT=Office2007_2010_2013
set CX=*.exe
set str=/quiet /norestart
goto TOP

:TOP
set title=%XT% 补丁批量安装程序
title %title%
set work=0
set no=0
set mo=0
set number=0
set hotfix=
set ko=▏
set kn=0
:Kong
if %kn% LSS 33 (set ko=%ko% &set /a kn=%kn%+1&goto Kong)
for /F %%s in ('dir /b /a-d %CX% ^| find /v /c ""') do set all=%%s
for /F %%i in ('dir /b /a-d /OD %CX%') do (set hotfix=%%i&call :show)
set hotfix=&call :show
goto end
:show
if %number% GTR %mo% (
set num=%num%█
set /a mo=%mo%+1
set ko=%ko:~0,-1%
goto show
)
cls
echo.
echo.
if "%hotfix%"=="" (echo     %title% ) else (echo       正在安装:%hotfix%)
echo                                                            進度: %no% / %all%
echo.&echo                                   已经完成 %work% %%%
echo     ┌──────────────────────────────────┐
echo     │%num%%ko%│&echo     │%num%%ko%│&echo     │%num%%ko%│
echo     └──────────────────────────────────┘
echo.
if %work%==100 goto :EOF
::ping -n 1 127.1 >nul
%str1% %hotfix% %str% >nul 2>nul
set /a no=%no%+1
set /a work=(%no%)*100/(%all%) 2>nul
set /a number=%work%/3
set /a number=%number%+1
goto :EOF

:end
echo       安装完成,按任意键退出... (建议从新启动系统)
pause>nul
exit

:next2
cls
echo.
echo.
echo    没找到补丁程序
echo.
echo    补丁程序需要和批量安装程序放在同一个文件夹内
echo.
echo    按任意键退出 ...
pause>nul&exit


第二个安装代码,比较简单些,使用方法同上
代码: 全选
@echo off
PUSHD %~dp0
color 0a
mode con lines=22
title 系统补丁批量安装程序
setlocal enabledelayedexpansion
If not exist *.exe (if not exist *.msu goto next2)
ver|find /i " 6." >nul||goto test
echo .>%windir%\test.txt
if exist %windir%\test.txt (
    del /f /q /a %windir%\test.txt>nul 2>nul
) else (
    cls
    echo.
    echo.
    echo    请右键◆以管理员身份运行◆本程序
    echo    按任意键退出...
    pause>nul
    exit
)
goto test2
:test
echo .>%windir%\test.txt
if exist %windir%\test.txt (
    del /f /q /a %windir%\test.txt>nul 2>nul
) else (
    cls
    echo.
    echo.
    echo    请以管理员身份登录电脑运行本程序
    echo    按任意键退出...
    pause>nul
    exit
)
:test2
ver | find "6." > NUL && (
for /f "delims=" %%i in ('dir /a-d /b /od Windows*-KB*.msu 2^>nul') do (
set str=%%i
echo.
echo.
echo     正在安装 !str!
wusa !str! /quiet /norestart
cls
))

ver | find "5." > NUL && (
for /f "delims=" %%i in ('dir /a-d /b /od Windows*-KB*.exe 2^>nul') do (
set str=%%i
echo.
echo.
echo     正在安装 !str!
!str! /quiet /norestart
cls
))
cls
echo.
echo.
echo       安装完成,按任意键退出... (建议从新启动系统)
pause>nul
exit

:next2
cls
echo.
echo.
echo    没找到补丁程序
echo.
echo    补丁程序需要和批量安装程序放在同一个文件夹内
echo.
echo    按任意键退出 ...
pause>nul
exit
大话西游
禁书达人
帖子: 1219

 


  • { RELATED_TOPICS }
    回复总数
    阅读次数
    最新文章

回到 防跨省隐藏踪迹安全技术交流

  • Advertisement
高速翻墙
cron