Board logo

标题: 请批处理高手来看一下  [打印本页]

作者: hotdog     时间: 2003-8-15 00:00    标题: 请批处理高手来看一下 

//echo :m_dir " 选择需要恢复的GHO文件 " [x]>%temp%\tmp.txt
dir %cdrom%\*.gho /b /s >>%temp%\tmp.txt
call w.bat list @%temp%\tmp.txt:m_dir
if errorlevel 100 goto _cmd
if "%wbat%"=="" goto _ERROR
set gfile=%wbat%//
//recur
call w.bat box @GCDROM.BAT:sc_1
if errorlevel 100 goto _cmd
if "%?%" == "1" goto _next
if "%?%" == "2" goto _sd
if "%?%" == "3" goto _cmd//
这两段哪位可以解释一下
:sc_2
。。。。。。。
::
:sc2
这段是怎么用的

批处理程序如下:
@echo off
REM   运行天汇汉字系统
TW /np /n3 > nul
cls
recur
call w.bat box @GCDROM.BAT:sc_1
if errorlevel 100 goto _cmd
if "%?%" == "1" goto _next
if "%?%" == "2" goto _sd
if "%?%" == "3" goto _cmd

goto sc1
:sc_1
※※※※※※※※※※※※※※※※※※※※※※※※※※
※                                                ※
※        [1. 全 自 动 恢 复 系 统       ]        ※
※                                                ※
※        [2. 我会用GHOST,用鼠标手动操作]        ※
※                                                ※
※        [3. DOS 命 令 行               ]        ※
※                                                ※
※※※※※※※※※※※※※※※※※※※※※※※※※※
::
:sc1

goto _end

rem 选择本盘恢复还是换一张盘恢复
:_next
recur
call w.bat box @GCDROM.BAT:sc_2
if errorlevel 100 goto _next
if "%?%" == "1" goto _no
if "%?%" == "2" goto _huan

goto sc2
:sc_2
※※※※※※※※※※※※※※※※※※※※※※※※※※
※                                                ※
※      [1. 恢复本张光盘上的*.gho文件      ]      ※
※                                                ※
※      [2. 换盘,恢复其它光盘上的*.gho文件]      ※
※                                                ※
※※※※※※※※※※※※※※※※※※※※※※※※※※
::
:sc2

goto _end

REM 换盘自动弹出光驱,并在暂停状态

:_huan
REM 弹出光盘eject.com
EJECT.COM > nul
recur
call w.bat box @GCDROM.BAT:sc_3
goto sc3
:sc_3

~Aborted...~

光盘已经弹出,请更换光盘后,按【确定】光盘会自动进盒,并继续……

                                                [ 确定(&O) ]
::
:sc3
REM 进盒load.exe
load.exe > nul
echo 请稍候,正在倒数计数,归零后程序继续进行!
REM            倒数计时20秒,调用wait.exe
wait 20
goto _no

REM 检测光盘镜像文件所在的位置和文件名!

:_no
echo :m_dir " 选择需要恢复的GHO文件 " [x]>%temp%\tmp.txt
dir %cdrom%\*.gho /b /s >>%temp%\tmp.txt
call w.bat list @%temp%\tmp.txt:m_dir
if errorlevel 100 goto _cmd
if "%wbat%"=="" goto _ERROR
set gfile=%wbat%

goto _txt

:_txt
recur
call w.bat box @GCDROM.BAT:sc_4
if errorlevel 100 goto _txt
if "%?%" == "1" goto _y

goto sc4
:sc_4
※※※※※※※※※※※※※※※※※※※※※※※※※※
※                                                ※
※   Copy disk image from CD-Rom to harddisk !!!  ※
※                                                ※
※   如果继续光盘上的备份文件将会拷贝到第一硬盘   ※
※   第一分区。                                   ※
※   按【确定】继续,按【取消】重新启动。         ※
※                                                ※
※                          [确定(&O)] [取消(&C)]   ※
※※※※※※※※※※※※※※※※※※※※※※※※※※
::
:sc4

goto _end

:_y
set tOK=
recur
call w.bat box @GCDROM.BAT:sc_5
if errorlevel 100 goto _end
if "%tOK%"=="OK" goto _ok

goto sc5
:sc_5

                     警告 !!!

    This will erase all data currently on your
    harddisk !!!
    请确定硬盘上您建立的文档是否备份好,如果继续

    将会删除C盘所有文档,不能恢复 !!!

※※※※※※※※※※※※※※※※※※※※※※※※※※
※                                                ※
※  4.5 版  2002年6月10日     huwuyuan@163.com    ※
※                                                ※
※※※※※※※※※※※※※※※※※※※※※※※※※※
  Type uppercase "OK" to confirm this action
  请输入大写“OK”并回车确认,按其它键后回车重启
  [$ tOK,2]

::
:sc5

goto _end

:_ok
set tOK=
cls
TW /Q
echo Loading...
rem without -rb switch! -quiet
ghost.exe -batch -sure -afile=NUL -clone,mode=pload,src=%gfile%:1,dst=1:1
rem ,szeL
if errorlevel 1 goto _abort
TW /np /n3 > nul
EJECT.COM > nul
recur
call w.bat box @GCDROM.BAT:scx_1
goto scx1
:scx_1
*****************************************************************

     Remove CD-Rom, and reboot system.

     恢复系统已顺利完成,请拿出光盘后,按【确定】重新启动系统。

*****************************************************************
                                                [ 确定(&O) ]
::
:scx1

goto _end

:_abort
TW /np /n3 > nul
EJECT.COM > nul

recur
call w.bat box @GCDROM.BAT:scx_2

goto scx2
:scx_2
*****************************************************************

        ~Aborted...~

        硬盘恢复出现错误,请联系技术人员,

        请拿出光盘后,按【确定】重新启动系统。

*****************************************************************
                                                [ 确定(&O) ]
::
:scx2

goto _end

:_ERROR
EJECT.COM > nul
recur
call w.bat box @GCDROM.BAT:scx_3

goto scx3
:scx_3
*****************************************************************

        ~Aborted...~

        你的光盘没有备份的镜像文件!!

        请拿出光盘后,按【确定】重新启动系统。

*****************************************************************
                                                [ 确定(&O) ]
::
:scx3

goto _end

:_end
RESTART.COM
SET gfile=
SET name=
echo.

:_sd
%ramd%:
ghost
goto _off

:_cmd
cls
%ramd%:
goto _off

:_off


[此贴子已经被作者于2003-8-16 14:48:21编辑过]



作者: cn_archer     时间: 2003-8-16 00:00
我建议还是用EasyBoot搞个中文的启动界面……
个人以为用Ghost.exe时尽量不要加载这些天汇之类的东东……
作者: hotdog     时间: 2003-8-16 00:00
怎么没有人帮我啊