|
GHOST-C1.BAT
@echo off
rem GHOST 备份向导
x:
cd\
call mouse.bat
:ini
if exist u.dat set a=2
if not exist u.dat set a=1
if %spt%==1 set b0=1
if %spt%==2 set b0=2
if exist u.dat set c=2
if not exist u.dat set c=1
if %spt%==1 set d=2
if %spt%==2 set d=3
set fn=c_pan
set sp=0
set zip=2
set wrb=2
set wcb1=0
if exist u.dat set shd_i=注意(U盘表示第1硬盘,本地硬盘表示成第2硬盘...)
if not exist u.dat set shd_i=
if %spt%==2 set spt_i=注意(隐藏分区表示第1分区,C盘表示为第2分区...)
if %spt%==1 set spt_i=
rem 备份1
:bak1
cls
call w.bat box (+white on +blue) @ghost_c1.bat:bak1_w #12
if errorlevel 100 goto exit
if errorlevel 2 goto exit
if errorlevel 1 goto bak2
:bak1_w " GHOST8.3 备份向导 " [x]
~%shd_i%~
第[$a,1]硬盘第[$b0,1]分区
~%spt_i%~
备份到
第[$c,1]硬盘第[$d,1]分区:\[$fn,30 ].gho (须符合8.3格式)
____________________________________________________________
压缩: [.] 低压缩(快) [.] 高压缩(中) [.] 最高压缩(慢)
分卷: [$SP,4] MB ("0"表示不分卷)
[!] 密码保护
____________________________________________________________
警告: 一旦按"备份",立即执行,原有映像将被覆盖!
提示: TAB键=跳转 空格键=选中 K键=开始 Esc键=返回
[ 备份(&K) ] [ 取消(&C) ]
::
rem 备份某一分区还是整个硬盘?
:bak2
set >set.txt
type set.txt|find "b0=" /i
if errorlevel 1 goto bak_disk
rem 某一分区
set dump1=pdump
call var set b1=string :%b0%
goto bak_sp
rem 整个硬盘
:bak_disk
set dump1=dump
set b1=
rem 压缩,分卷,密码
:bak_sp
rem 低压缩
if %wrb%==1 set zip=1
rem 最高压缩
if %wrb%==3 set zip=9
rem 分卷吗?
set >set.txt
if %sp%==0 goto bak_sp1
goto bak_sp2
rem 不分卷,并且是否有密码?
:bak_sp1
cls
if %wcb1%==1 goto pwd1
if %wcb1%==0 goto pwd0
rem 无密码
:pwd0
quit
call mouse.bat
ghost -clone,mode=%dump1%,src=%a%%b1%,dst=%c%:%d%:\%fn%.gho -z%zip% -auto -fro -sure -fx
if errorlevel 1 goto bak21
goto bak20
rem 有密码
:pwd1
rem set gho_fn=1b
call ghost_p1
if "%pwa%"=="0" goto pwd0
quit
call mouse.bat
ghost -clone,mode=%dump1%,src=%a%%b1%,dst=%c%:%d%:\%fn%.gho -z%zip% -auto -fro -sure -fx -pwd=%pw1%
if errorlevel 1 goto bak21
goto bak20
rem 分卷
:bak_sp2
cls
if %wcb1%==1 goto pwd1a
if %wcb1%==0 goto pwd0a
rem 无密码
:pwd0a
quit
call mouse.bat
ghost -clone,mode=%dump1%,src=%a%%b1%,dst=%c%:%d%:\%fn%.gho -z%zip% -auto -fro -sure -fx -span -split=%sp%
if errorlevel 1 goto bak21
goto bak20
rem 有密码
:pwd1a
rem set gho_fn=1b
call ghost_p1
if "%pwa%"=="0" goto pwd0a
quit
call mouse.bat
ghost -clone,mode=%dump1%,src=%a%%b1%,dst=%c%:%d%:\%fn%.gho -z%zip% -auto -fro -sure -fx -span -split=%sp% -pwd=%pw1%
if errorlevel 1 goto bak21
rem 没出错
:bak20
rem 设置映像为隐含属性
call x:\ifs\load.bat
for %%r in (c d e f g h i j k l m n o p q r s t u v w) do set drv_r=%%r
attrib -a -r -s +h %drv_r%:\%fn%.gho
attrib -a -r -s +h %drv_r%:\*.ghs
call x:\ifs\unload.bat
rem 显示备份成功
call tway.bat
call mouse.bat
cls
call w.bat box (+white on +blue) @ghost_c1.bat:bak20_w #1,20
if errorlevel 100 goto exit
if "%?%"=="2" goto off
if "%?%"=="1" goto boot
:bak20_w " OK! " [X]
备份 成功!
[ 重启(&R) ] [ 关机(&S) ]
#? 秒后自动重启
::
rem 出错了
:bak21
rem 建立失败详情
:bak21_i
set echo1=0
set echo2=解决方法: 清理第%c%硬盘第%d%分区里的无用文件,为存放映像腾出更多空间
cls
rem #519
:e519
type ghosterr.txt|find /i "(519)" >nul
if errorlevel 1 goto e651
echo. >>ghosterr.txt
set echo1=错误519: 存放映像文件的分区(第%c%硬盘第%d%分区)没有足够空间
echo %echo1% >>ghosterr.txt
echo %echo2% >>ghosterr.txt
goto bak21_r
rem #651
:e651
type ghosterr.txt|find /i "(651)" >nul
if errorlevel 1 goto e657
echo. >>ghosterr.txt
set echo1=错误651: 用户中断操作,因为不能在第%c%硬盘第%d%分区里定位一个映像分卷
echo %echo1% >>ghosterr.txt
echo %echo2% >>ghosterr.txt
goto bak21_r
rem #657
:e657
type ghosterr.txt|find /i "(657)" >nul
if errorlevel 1 goto e10032
echo. >>ghosterr.txt
set echo1=错误657: 经过估算,存放映像文件的分区(第%c%硬盘第%d%分区)剩余空间太小
echo %echo1% >>ghosterr.txt
echo %echo2% >>ghosterr.txt
goto bak21_r
rem #10032
:e10032
type ghosterr.txt|find /i "(10032)" >nul
if errorlevel 1 goto e11032
echo. >>ghosterr.txt
set echo1=错误10032: CMOS的硬盘的侦测模式可能错误.
set echo2=解决方法: 进入CMOS -> Standard CMOS Setup,更改硬盘侦测模式为"AUTO".
echo %echo1% >>ghosterr.txt
echo %echo2% >>ghosterr.txt
goto bak21_r
rem #11032
:e11032
type ghosterr.txt|find /i "(11032)" >nul
if errorlevel 1 goto e36000
echo. >>ghosterr.txt
set echo1=错误11032: 存放映像的分区(第%c%硬盘第%d%分区)空间已满
echo %echo1% >>ghosterr.txt
echo %echo2% >>ghosterr.txt
goto bak21_r
rem #36000
:e36000
type ghosterr.txt|find /i "(36000)" >nul
if errorlevel 1 goto e36002
echo. >>ghosterr.txt
set echo1=错误36000: 常规错误(可能原因:第%c%硬盘第%d%分区不存在)
echo %echo1% >>ghosterr.txt
echo %echo2% >>ghosterr.txt
goto bak21_r
rem #36002
:e36002
type ghosterr.txt|find /i "(36002)" >nul
if errorlevel 1 goto e662
echo. >>ghosterr.txt
set echo1=错误36002: 用户中断操作,备份未完成!
set echo2=解决方法: 请再次备份.
echo %echo1% >>ghosterr.txt
echo %echo2% >>ghosterr.txt
goto bak21_r
rem #662
:e662
type ghosterr.txt|find /i "(662)" >nul
if errorlevel 1 goto bak21_r
echo. >>ghosterr.txt
set echo1=错误 662: 不能建立映像
echo %echo1% >>ghosterr.txt
set echo2=解决方法: 首先安装硬盘版,然后再使用光盘版/优盘版.
echo %echo2% >>ghosterr.txt
goto bak21_r
rem 显示失败详情
:bak21_r
echo -------------备份向导---------------- >>x:\ghosterr.txt
echo 以下是GHOST磁盘检测信息 >>x:\ghosterr.txt
copy /y x:\ghosterr.txt+x:\ghststat.txt x:\ghosterr.txt >nul
call x:\ifs\load.bat
call gho_drv.bat
copy /y x:\ghosterr.txt %drv_z%:\boot\%ghox% >nul
call x:\ifs\unload.bat
call tway.bat
call mouse.bat
if %echo1%=="0" goto bak21_y
rem 显示失败详情(已知错误)
:bak21_x
cls
call w.bat box (+white on red) @ghost_c1.bat:bak21_1
if errorlevel 100 goto exit
if "%?%"=="2" goto boot
if "%?%"=="1" goto bak21_z
:bak21_1 " Sorry! " [x]
备份 失败!
%echo1%
%echo2%
[ 详情(&L) ] [ 重启(&R) ]
::
rem 显示失败详情(未知错误)
:bak21_y
cls
call w.bat box (+white on red) @ghost_c1.bat:bak21_2
if errorlevel 100 goto exit
if "%?%"=="2" goto boot
if "%?%"=="1" goto bak21_z
:bak21_2 " Sorry! " [x]
备份 失败!
[ 详情(&L)] [ 重启(&R) ]
::
:bak21_z
read ghosterr.txt
cls
goto exit
:off
func -s
:boot
func -r
:exit |
|