当前位置:DOS资源站资料中心批处理教程 → 开机通道批量升级迅闪还原脚本

开机通道批量升级迅闪还原脚本

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-5-26 17:50:51

批处理代码作者:网管联盟LZ-MyST
功能介绍:
1、支持升级指定机器。
2、还原更新时有提示。
3、升级还原时会自动重起三次;第一次卸载后会重起;第二次启动到一半会自动重起一次;第三次安装完成会重起一次;

第一部分代码——批量生成需要升级的机器列表。
 程序代码set 计算机名前缀=PC
for /l %%i in (1,1,254) do (
   if %%i lss 10 (
     >>机器列表.txt echo %计算机名前缀%00%%i
   ) else (
     if %%i lss 100 (>>机器列表.txt echo %计算机名前缀%0%%i) else >>机器列表.txt echo %计算机名前缀%%%i
   )
)

第二部分代码——开机通道升级迅闪/DF/以及其他支持命令行安装的还原软件。

set serverpath=\\server\share$\设置一个可写的共享目录。
%serverpath%\xsuplog\设置卸载和更新后的标记文件目录。
%serverpath%\xsupfile\设置迅闪新版程序所在目录。

 程序代码@echo off
set serverpath=\\server\share$\
for /f %%i in (%serverpath%\xsuplog\机器列表.txt) do if %%i == %computername% goto up
goto end_up

:up
if exist %serverpath%\xsuplog\%computername%_end.txt goto end_up
if exist %serverpath%\xsuplog\%computername%_uninstall.txt goto INSTALL

:UNINSTALL
echo/>%serverpath%\xsuplog\%computername%_uninstall.txt
"%ProgramFiles%\HintSoft\Recover\RecoverSetup.exe" /UNINSTALL /PWD:12345678   /RBOOT
exit

:INSTALL
echo msgbox "正在更新还原软件,请勿动!升级完成后计算机会自动重起!",0,"★更新还原软件,勿动!★">%temp%\tip.vbs
start %temp%\tip.vbs
xcopy  %serverpath%\xsupfile\*.* "C:\Program Files\HintSoft\Recover\" /d/r/y/e/h
echo/>%serverpath%\xsuplog\%computername%_end.txt
"%ProgramFiles%\HintSoft\Recover\RecoverSetup.exe" /INSTALL /safe:cdef /PWD:12345678   /RBOOT
exit

:end_up