|
@echo off
rem win7pe.iso 中含BEIKEL SHOWDRIVERS GDISK32
REM win7pe.iso 在第一分区或在系统分区则备份到最后分区,否则备份到win7pe.iso所在分区
color 1f
cls
showdrivers.exe >nul
echo.
echo.
echo. 【XX电脑系统一键备份】
echo.
echo.请稍后……
for %%b in (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r:) do if exist %%b\win7pe.iso set bak=%%b
:actp
for /f "tokens=1,3" %%i in ('gdisk32 1') do (if %%j*==A* set sysp=%%i)
if not "%sysp%"=="" goto :name
:noactp
for /f "tokens=1,2" %%i in ('gdisk32 1') do (if %%j*==1* set sysp=%%i)
:name
if exist %sysp%\bootmgr set name=win7
if exist %sysp%\ntldr set name=winxp
if "%name%"=="" set name=sys
if exist %sysp%\win7pe.iso goto :last
:output
set n=%date:~0,4%
set y=%date:~5,2%
set r=%date:~8,2%
set a=%time:~0,1%
if "%a%"==" " set a=0
set b=%time:~1,1%
set h=%a%%b%
set m=%time:~3,2%
set d=%n%%y%%r%%h%%m%
set sysp=%sysp:~0,1%
echo [General]>config.ini
echo ImageXmlPath=%bak%/>>config.ini
echo OutPutLogPath=%bak%/>>config.ini
echo OuputLogFile=1>>config.ini
echo Language=zh_CN>>config.ini
echo AutoProc=Yes>>config.ini
echo Type=Backup>>config.ini
if exist %bak%\%name%.bkp (echo BackupType=Increamental>>config.ini ) else (echo BackupType=full>>config.ini )
echo Partition=%sysp%>>config.ini
if exist %bak%\%name%.bkp (echo ImageFile=%bak%/%name%_%d%.bkp>>config.ini) else (echo ImageFile=%bak%/%name%.bkp>>config.ini)
if exist %bak%\%name%.bkp (echo PrevImageFile=%bak%/%name%.bkp>>config.ini) else (echo PrevImageFile=>>config.ini)
echo CompressLevel=None>>config.ini
if exist %bak%\%name%.bkp (echo Comment=%name%系统用户增量备份于%n%年%y%月%r%日%h%时%m%分>>config.ini) else (echo Comment=%name%系统出厂备份于%n%年%y%月%r%日%h%时%m%分>>config.ini)
echo Password=>>config.ini
echo FixSize=Auto>>config.ini
echo RestoreMBR=No>>config.ini
echo ProcConfirm=Yes>>config.ini
start beikel3.exe
exit
:last
for /f "tokens=1,2" %%i in ('gdisk32') do (if %%i*==1* set pn=%%j)
for /f "tokens=1,2" %%i in ('gdisk32 1') do (if %%j*==%pn%* set bak=%%i)
goto :output
[ 本帖最后由 xiaoy 于 2012-2-25 21:42 编辑 ] |
|