这是给新手用的一个用WBAT编写的程序,很简单。
该功能已是老生常谈了。 ^-^ 朋友的IBM笔记本自带的还原功能不好用,所以给他改了个GHOST,不妨大家用用。
用于实践的系统备份和还原,主要优点就是可以自动隐藏备份分区。
部分程序和效果:
@echo off
TW /np /n3 > nul
:chk_pwd_file
dir pwd /b /s >>tmp
if NOT EXIST pwd goto _no_pwd_fil
if EXIST pwd goto read_pwd
GOTO _NEND
:read_pwd
copy pwd pwd_1 /y
strings pt= read pwd_1 ,1
del pwd_1
goto start-copyright
:change_pwd
set cpwd_1=
set cpwd_2=
wbat cls ! text 4,12 (black on white) @:chg-pwd
call w.bat box 9,20 @:chg-box_1
if errorlevel 100 goto _menu
if "%cpwd_1%" == "" goto _pwd_empty
call w.bat box 9,17 @:chg-box_2
if errorlevel 100 goto _menu
if %cpwd_1% == %cpwd_2% goto chg
if not %cpwd_1% == %cpwd_2% goto _pwd_ero
goto _nend
:chg
echo %cpwd_2%>pwd
set cpwd_1=
set cpwd_2=
call w.bat box 9,20 @:c-cop
goto _menu
:_pwd_ero
set cpwd_1=
set cpwd_2=
RECUR
call w.bat box @:chg_eor_box
if errorlevel 100 goto _menu
if errorlevel 1 goto change_pwd
:_pwd_empty
call w.bat box 9,20 @:chg_empty_box
if errorlevel 100 goto _menu
if errorlevel 1 goto change_pwd
:_no_pwd_fil
wbat pal ! font ! cls ! fill 8,4 (15,74) (black on +green)
wbat text 2,4 :start_1 ! text 24,4 :copyright
wbat box 7,14 (red on +white) @:no_pwd_file
if errorlevel 100 goto _menu
if errorlevel 2 goto _menu
if errorlevel 1 goto change_pwd
:start-copyright
wbat pal ! font ! cls ! fill 8,4 (15,74) (black on +green)
wbat text 2,4 :start_1 ! text 24,4 :copyright
set Wtexthi=
wbat box 20,50 按任意键继续..... #1,10
if errorlevel 100 goto start
if errorlevel 1 goto start
:start
wbat pal ! cls ! fill 2,4 (20,74) (black on +brown)
set Wtexthi=blue on +brown
set Wtexthi=
set password=
wbat cls ! text 4,12 (red on white) @:pass-info !
call w.bat box 8,24 @:pass-box
if errorlevel 100 goto _quit
goto _chk-pass
:_quit
call w.bat box 8,31 @:quit_box
if errorlevel 100 goto start
if errorlevel 2 goto start
rem if errorlevel 1 goto _reboot
goto _reboot
:_chk-pass
rem if errorlevel 100 goto start
if not "%password%" == "%pt%" goto _pwd-error
if "%password%" == "%pt%" goto _menu
goto _nend
:_pwd-error
call w.bat box 6,17 @:pwd-error
if errorlevel 100 goto start
if errorlevel 2 goto _reboot
goto start
:_menu
wbat pal ! cls ! fill 2,4 (23,74) (black on +brown)
recur
call w.bat box @:sc_1
if errorlevel 100 goto _MENU
if "%?%" == "1" goto _backup
if "%?%" == "2" goto _recover
if "%?%" == "3" goto change_pwd
if "%?%" == "4" goto _reboot
if "%?%" == "5" goto _readme
goto sc1
:_backup
wbat pal ! cls ! fill 2,4 (23,74) (black on +green)
wbat text 4,8 (22,74) (black on white) @:bakup
call wbat box 15,19 (light blue on light white) @:alarm_b
if errorlevel 2 goto _MENU
cls
TW /Q
echo ghost.exe -clone,mode=pdump,src=1:1,dst=c:\winsys.gho -sure -fx
TW /np /n3 > nul
wbat cls ! text 4,8 (light blue on light white) @:bak-cop ! box 15,30 [ 确 定 ]
GOTO _MENU
:_recover
dir winsys.gho /b /s >>tmp.txt
if NOT EXIST winsys.gho goto _ERROR
if EXIST winsys.gho goto _rec
GOTO NEND
:_ERROR
DEL TMP.TXT
RECUR
CALL W.BAT BOX @:ERROR
GOTO _MENU
:_rec
DEL TMP.TXT
wbat pal ! cls ! fill 2,4 (23,74) (black on +green)
wbat text 4,8 (black on light white) @:rec
call wbat box 15,19 (light white on light red ) @:alarm_r
if errorlevel 2 goto _MENU
cls
TW /Q
echo ghost -clone,mode=pload,src=c:\winsys.gho:1,dst=1:1 -sure -fx
TW /np /n3 > nul
wbat cls ! text 4,8 (light blue on light white) @:rec-cop
call wbat box 15,30 @:sce_0 #1,1
if errorlevel 100 goto _reboot
call wbat box 15,30 @:sce_1 #1,1
if errorlevel 100 goto _reboot
call wbat box 15,30 @:sce_2 #1,1
if errorlevel 100 goto _reboot
call wbat box 15,30 @:sce_3 #1,1
if errorlevel 100 goto _reboot
call wbat box 15,30 @:sce_4 #1,1
if errorlevel 100 goto _reboot
call wbat box 15,30 @:sce_5 #1,1
if errorlevel 100 goto _reboot
goto _reboot
:_reboot
reboot r
:_readme
recur
call w.bat box @:readme
if errorlevel 100 goto _menu
goto _menu
:_NEND