功能:自动判断当前系统,并逐个运行当前文件夹里面的系统补丁包程序。
@echo off :: hnfeng 20120416 :: ◆自动运行文件夹里面所有系统补丁程序并显示总进度及正在安装的程序名◆ :: ================================ cd /d "%~dp0"&color 3E&mode con lines=15 &title 补丁包批处理安装程序〔hnfeng〕 ver | find "6.1" > NUL && (set XT=Windows7&set CX=Windows6.1-KB*.msu&set CS=/quiet /norestart&goto TOP) ver | find "5.1" > NUL && (set XT=WindowsXP&set CX=WindowsXP-KB*.exe&set CS=/quiet /norestart /nobackup&goto TOP) ver | find "5.0" > NUL && (set XT=Windows2000&set CX=Windows2000-KB*.exe&set CS=/quiet /norestart /nobackup&goto TOP) ver | find "5.2" > NUL && (set XT=Windows2003&set CX=WindowsServer2003-KB*.exe&set CS=/quiet /norestart /nobackup&goto TOP) ver | find "6.0" > NUL && (set XT=WindowsVista&set CX=Windows6.0-KB*.msu&set CS=/quiet /norestart&goto TOP) :: ================================ :TOP set title=%XT% 补丁包批处理安装程序〔hnfeng〕 title %title% set work=0&set n=0&set mo=0&set number=0&set hotfix= if not exist %CX% echo.&echo.&echo 没找到补丁程序,按任意键退出 ...&echo.&echo.&echo (该批处理应该在系统补丁程序所在文件夹里运行.)&pause>nul&exit set k=▏&set kn=0 :Kong if %kn% LSS 33 (set k=%k% &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 :check if %number% GTR %mo% set num=%num%█&set /a mo=%mo%+1&set k=%k:~0,-1%&goto check cls&echo.&echo. if "%hotfix%"=="" (echo %title% ) else (echo 正在安装:%hotfix% ...) echo 进度: %n% / %all% echo.&echo 已经完成 %work% %%% echo ┌──────────────────────────────────┐ echo │%num%%k%│&echo │%num%%k%│&echo │%num%%k%│ echo └──────────────────────────────────┘ echo. if not "%hotfix%"=="" echo hnfeng.2012.4 if %work%==100 goto :EOF ::ping 127.1 -n 2 >nul %hotfix% %CS% set /a n=%n%+1 set /a work=(%n%)*100/(%all%) set /a number=%work%/3 set /a number=%number%+1 goto :EOF :end echo 运行完成,请按任意键退出... (建议重新启动系统) pause>nul&exit
如果需要打Office补丁的进度条代码,只需把这几行删掉
ver | find "6.1" > NUL && (set XT=Windows7&set CX=Windows6.1-KB*.msu&set CS=/quiet /norestart&goto TOP) ver | find "5.1" > NUL && (set XT=WindowsXP&set CX=WindowsXP-KB*.exe&set CS=/quiet /norestart /nobackup&goto TOP) ver | find "5.0" > NUL && (set XT=Windows2000&set CX=Windows2000-KB*.exe&set CS=/quiet /norestart /nobackup&goto TOP) ver | find "5.2" > NUL && (set XT=Windows2003&set CX=WindowsServer2003-KB*.exe&set CS=/quiet /norestart /nobackup&goto TOP) ver | find "6.0" > NUL && (set XT=WindowsVista&set CX=Windows6.0-KB*.msu&set CS=/quiet /norestart&goto TOP)
然后在此处增加下面内容:
set XT=Office2007_2010 set CX=*.exe set CS=/quiet /norestart
如果是 Office2003,就这样:
set XT=Office2003 set CX=*.exe set CS=/q
© 版权声明
1.文章资源部分来自互联网,仅供学习参考使用。
2.商用请支持正版。若不听劝告,出现任何后果,均与本站无关。
3.建议大家Ctrl+D收藏本站,网站持久离不开大家的鼓励和支持!
4.用户需自行判断软件的安全性和可用性,不建议下载破解版。
5.果园资源是对站点整理、编辑、运维的适当补助,非资源价格。
6.重要!跳转没有下载入口,请在该页面下留言或私信(加上标题或链接)
THE END
暂无评论内容