|
本帖最后由 gxbcm 于 2024-6-22 14:09 编辑
@echo off
%1 mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&&exit /b
pushd "%CD%"
CD /D "%~dp0"
mode con cols=90 lines=90
SET BPFB=C:
SET BPFH=C:
SET DIRS=C:
SET ES=C:
SET BPFE=C:
SET WE=ESD
SET EWS=ESD
SET NM=OKK
SET BOO=关闭
SET UP=关闭Y:
SET AA1=1
SET KK=OFF1
SET XX1=1
SET n=1
SET MRSZ=DD
SET CCXX=CC
SET SDMS=DD
SET BFHF=BB
SET YS=--compress=LZX:20
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z ) do (
SET SNADIR=%%a:\SNAP\
SET DIRSD=%%a:
SET DIRSDWJ=%%a:
SET WZ=%SNADIR%SYSC%XX1%.%WE%
SET WZ1=%SNADIR%SYSC%XX1%.%WE%
IF exist %%a:\SNAP\ GOTO MENU2
IF exist %%a: SET n1=%%a
)
SET DIRS=%n1%
SET /P DIRS= 请输入备份存放工作盘(C-%DIRS%)字母回车:
SET SNADIR=%DIRS%:\SNAP\
MD %SNADIR%
GOTO MENU2
EXIT
:MENU2
cmd /c "echo list disk & echo select vol 1 & echo select partition 1 & echo list partition"|diskpart >TBIA.TXT
(for /f "tokens=1* delims=:" %%a in ('findstr /n .* TBIA.TXT') do echo %%a-%%b)>TBIA1.TXT
For /f "delims=" %%i in ( 'Type TBIA1.TXT^|findstr "10-"' ) do (ECHO.%%i>TBIAC.TXT)
For /f "delims=" %%i in ( 'Type TBIA1.TXT^|findstr "22-"' ) do (ECHO.%%i>TBIAM.TXT)
SET /P TBIAS=<TBIAM.TXT
SET TBIAB=%TBIAS:~18,2%
IF /I %TBIAB% equ 未知 SET TBIC=C3
IF /I %TBIAB% equ 已保 SET TBIC=C3
IF /I %TBIAB% equ 主要 SET TBIC=C2
SET /P GPTM=<TBIAC.TXT
SET GPTMA=%GPTM:~52,1%
if /I "%GPTMA%" == "*" (
if /I "%TBIC%" == "C3" SET bios=uefi
if /I "%TBIC%" == "C2" SET bios=uefi
) ELSE (
SET bios=bios
)
IF NOT EXIST %SNADIR%CONFIG.TXT ECHO.ESD DD CC DD BB>%SNADIR%CONFIG.TXT
SET /P EWSR=<%SNADIR%CONFIG.TXT
SET EWS=%EWSR:~0,3%
SET MRSZ=%EWSR:~4,2%
SET CCXX=%EWSR:~7,2%
SET SDMS=%EWSR:~10,2%
SET BFHF=%EWSR:~13,2%
IF %EWS% equ ESD SET WE=%EWS% & SET YS=--compress=LZX:20
IF %EWS% equ WIM SET WE=%EWS% & SET YS=--compress=XPRESS%
IF %EWS% equ SNA SET WE=%EWS% & SET YS=
IF %EWS% equ TBI SET WE=%EWS% & SET YS=COMP:15
IF %errorlevel%==1 CLS & GOTO PASS
:MENU
SET Bn=0
SET Hn=0
IF NOT EXIST %SNADIR%00.DPT (
BOOTICE /DEVICE=0 /PARTITIONS /BACKUP_DPT=00.DPT /QUIET
COPY 00.DPT %SNADIR% /Y
)
IF "%KK%"=="OFF1" (
SET KK1=关闭
SET KK=OFF1
) ELSE (
SET KK1=开启
SET KK=--wimboot
)
IF EXIST %PF%%LJ%%WJ%.ESD @wimlib-imagex.exe info %PF%%LJ%%WJ%.ESD>EWJ.txt
IF EXIST %PF%%LJ%%WJ%.ESD @findstr "Image Count:" EWJ.TXT >EWJ1.TXT & SET /P WEAA=<./EWJ1.TXT
IF EXIST %PF%%LJ%%WJ%.WIM @wimlib-imagex.exe info %PF%%LJ%%WJ%.WIM>WWJ.txt
IF EXIST %PF%%LJ%%WJ%.WIM @findstr "Image Count:" WWJ.TXT >WWJ1.TXT & SET /P WWAA=<./WWJ1.TXT
IF %errorlevel%==1 CLS & GOTO PASS
IF %WE% equ ESD (
SET /A WAA1=%WEAA:~16,1%
SET WCK=EWJ.txt
SET WWZ1=%PF%%LJ1%%WJ%%KZ%
SET WWZ=%PF%%LJ%%WJ%%KZ%
) ELSE (
SET /A WAA1=%WWAA:~16,1%
SET WCK=WWJ.txt
SET WWZ1=%PF%%LJ1%%WJ%%KZ%
SET WWZ=%PF%%LJ%%WJ%%KZ%
)
IF EXIST %SNADIR%SYSC%XX1%.ESD @wimlib-imagex.exe info %SNADIR%SYSC%XX1%.ESD>ESD%XX1%.txt
IF EXIST %SNADIR%SYSC%XX1%.ESD @findstr "Image Count:" ESD%XX1%.TXT >ESD1%XX1%.TXT & SET /P EAA=<./ESD1%XX1%.TXT
IF EXIST %SNADIR%SYSC%XX1%.WIM @wimlib-imagex.exe info %SNADIR%SYSC%XX1%.WIM>WIM%XX1%.txt
IF EXIST %SNADIR%SYSC%XX1%.WIM @findstr "Image Count:" WIM%XX1%.TXT >WIM1%XX1%.TXT & SET /P WAA=<./WIM1%XX1%.TXT
IF %errorlevel%==1 CLS & GOTO PASS
IF %WE% equ ESD (
SET /A EAA1=%EAA:~16,1%
SET ECK=ESD%XX1%.TXT
SET WEZ=%SNADIR%SYSC%XX1%.%WE%
SET WEZ1=%SNADIR%SYSC%XX1%.%WE%
) ELSE (
SET /A EAA1=%WAA:~16,1%
SET ECK=WIM%XX1%.TXT
SET WEZ=%SNADIR%SYSC%XX1%.%WE%
SET WEZ1=%SNADIR%SYSC%XX1%.%WE%
)
IF %WE% equ SNA (
for /l %%i in (1,1,10) do (
SET WZ1=%SNADIR%SYSC%%i.%WE%
SET WZ=%SNADIR%SYSC%%i.%WE%
IF NOT EXIST %SNADIR%SYSC%%i.SNA SET /A SBn=n & SET /A SHn=n-1 & GOTO PASNA
set /a n=%%i+1
)
:PASNA
SET Hn=%SHn%
SET Bn=%SBn%
SET WZ1=%SNADIR%SYSC%Bn%.SNA
SET WZ=%SNADIR%SYSC%Bn%.SNA
GOTO MESSS
)
IF %WE% equ TBI (
SET Tn=1
for /l %%i in (1,1,10) do (
SET WZ1=%SNADIR%SYSC%%i.%WE%
SET WZ=%SNADIR%SYSC%%i.%WE%
IF NOT EXIST %SNADIR%SYSC%%i.TBI SET /A TBn=Tn & SET /A THn=Tn-1 & GOTO PATBI
set /a Tn=%%i+1
)
:PATBI
SET Hn=%THn%
SET Bn=%TBn%
SET WZ1=%SNADIR%SYSC%Bn%.TBI
SET WZ=%SNADIR%SYSC%Bn%.TBI
GOTO MESSS
)
:PASS
IF %NM% equ OFFN (
for /l %%i in (1,1,%WAA1%) do set /a WAA2=%%i
SET /A Bn=WAA2+1
SET /A Hn=WAA2
SET WZ1=%WWZ1%
SET WZ=%WWZ%
SET CK=%WCK%
GOTO MESSS
)
for /l %%i in (1,1,%EAA1%) do set /a EAA2=%%i
IF NOT EXIST %SNADIR%SYSC%XX1%.%WE% (
SET /A Bn=0
SET /A Hn=0
SET WZ=%WEZ%
SET WZ1=%WEZ1%
) ELSE (
SET /A Bn=EAA2+1
SET /A Hn=EAA2
SET WZ=%WEZ%
SET WZ1=%WEZ1%
SET CK=%ECK%
)
GOTO MESSS
)
:MESSS
SET BNB=%Bn%
SET BHH=%Hn%
:MENU5
CLS
color 1f
echo. ESDSNATBI一键自动备份恢复系统--%WE%文件
echo. [SZ]默认设置 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
if /I %MRSZ% == SZ echo. [L]挂载ESP %ES%盘 [W]关联ESP-系统%BPFE%盘 [F]修复ESP引导 [N]隐藏ESP分区
if /I %MRSZ% == SZ echo. [B]默认备份%BPFB%盘 [P]参数Wimboot%KK1% [O]分区表 [X]选择文件SYSC%XX1%.%WE%
if /I %MRSZ% == SZ echo. [H]默认恢复%BPFH%盘 [T]参数Boot%BOO% [U]%UP%虚拟盘 [R]查看镜像信息
if /I %MRSZ% == SZ echo. [Y]压缩模式:%YS%
if /I %CCXX% == CC (echo. [CC]存储信息 ---------------------------------------------------------------------------) ELSE (echo. [CC]存储信息)
if /I %CCXX% == CC echo. [C]默认搜索%DIRSDWJ%盘 [S]搜索镜像%WE%文件 [K]重建镜像
if /I %CCXX% == CC echo. 备份存储目录%WZ1%
if /I %CCXX% == CC echo. 映像文件中%BHH%个备份
if /I %CCXX% == CC echo. [-] 备份第%Bn%个备份 恢复第%Hn%个备份
if /I %BFHF% == BB (echo. [BB]备份恢复 ---------------------------------------------------------------------------) ELSE (echo. [BB]备份恢复)
if /I %BFHF% == BB echo. [5] 一键自动备份系统 [BF]
if /I %BFHF% == BB echo.
if /I %BFHF% == BB echo. [0] 一键自动恢复系统 [HF]
if /I %BFHF% == BB echo.
if /I %BFHF% == BB echo. [8] 删除一个增量备份
if /I %BFHF% == BB echo.
if /I %BFHF% == BB echo. [2] 查看备份%SNADIR%目录
if /I %SDMS% == SD (echo. [SD]手动模式 ---------------------------------------------------------------------------) ELSE (echo. [SD]手动模式)
if /I %SDMS% == SD echo. [ESD] 手动CGI备份恢复 [WIM]
if /I %SDMS% == SD echo. [SNA] 手动SNAPSHOT备份恢复
if /I %SDMS% == SD echo. [TBI] 手动IMAGEW FOR WINDOWS备份恢复
echo. ----------------------------------------------------------------------------------------
echo. [E]退出 [Q]重启 [G]转换格式:%WE% [M]保存界面启动模式%EWS% Ver 5.3.1
echo. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SET ST1=2
SET /P ST1=请输入选项命令(默认:%ST1%)回车:
if /I "%ST1%"=="5" goto winbackup
if /I "%ST1%"=="0" goto winrecover
if /I "%ST1%"=="2" goto folderopen
if /I "%ST1%"=="G" goto GHWZ
if /I "%ST1%"=="F" goto XZ
if /I "%ST1%"=="B" goto BPFB
if /I "%ST1%"=="L" goto ES1
if /I "%ST1%"=="SZ" goto MRMR
if /I "%ST1%"=="CC" goto MRCC
if /I "%ST1%"=="SD" goto MRSD
if /I "%ST1%"=="BB" goto BFBB
if /I "%ST1%"=="-" goto HUIFU
if /I "%ST1%"=="W" goto BPFE1
if /I "%ST1%"=="BF" goto winbackup
if /I "%ST1%"=="HF" goto winrecover
if /I "%ST1%"=="H" goto BPFH1
if /I "%ST1%"=="N" goto NN
if /I "%ST1%"=="Q" goto QQ
if /I "%ST1%"=="Y" goto YY
if /I "%ST1%"=="O" goto MENU1
if /I "%ST1%"=="X" goto XX
if /I "%ST1%"=="M" goto MM
if /I "%ST1%"=="R" goto RR
if /I "%ST1%"=="U" goto UU
if /I "%ST1%"=="8" goto SC
if /I "%ST1%"=="e" goto exit
if /I "%ST1%"=="C" goto CC5
if /I "%ST1%"=="T" goto TT
if /I "%ST1%"=="K" goto KK
if /I "%ST1%"=="S" goto ZZ
if /I "%ST1%"=="P" GOTO KSK
if /I "%ST1%"=="SNA" goto SHOU
if /I "%ST1%"=="ESD" goto SHOUE
if /I "%ST1%"=="WIM" goto SHOUW
if /I "%ST1%"=="TBI" goto SHOUT
GOTO MENU5
:BFBB
IF /I %BFHF% equ BB (SET BFHF=DD) ELSE (SET BFHF=BB)
GOTO MENU5
:MRMR
IF /I %MRSZ% equ SZ (SET MRSZ=DD) ELSE (SET MRSZ=SZ)
GOTO MENU5
:MRCC
IF /I %CCXX% equ CC (SET CCXX=DD) ELSE (SET CCXX=CC)
GOTO MENU5
:MRSD
IF /I %SDMS% equ SD (SET SDMS=DD) ELSE (SET SDMS=SD)
GOTO MENU5
:HUIFU
if %Bn% equ 0 GOTO MENU5
if %Bn% equ 1 (SET /A Bn=%BNB% & SET /A Hn=%BHH% & CLS & goto MENU5) ELSE (SET /A Bn=%Bn%-1 & SET /A Hn=%Hn%-1 & CLS & goto MENU5)
GOTO MENU5
:SHOUE
CGI-WIMLIB.EXE
GOTO MENU
EXIT
:SHOUW
CGI-WIMLIB.EXE
GOTO MENU
EXIT
:SHOUT
IMAGEW64.EXE
GOTO MENU
EXIT
:SHOU
SNAPSHOT64.EXE -L0
GOTO MENU
EXIT
:MM
IF %WE% equ ESD SET EWS=ESD
IF %WE% equ WIM SET EWS=WIM
IF %WE% equ SNA SET EWS=SNA
IF %WE% equ TBI SET EWS=TBI
ECHO.%EWS% %MRSZ% %CCXX% %SDMS% %BFHF%>%SNADIR%CONFIG.TXT
GOTO MENU5
:TT
IF %BOO% equ 关闭 (
SET BOO=开启
) ELSE (
SET BOO=关闭
)
GOTO MENU
:KK
IF NOT EXIST %WZ% GOTO MENU
SET P8=%WZ%
ECHO.按E键-返回主菜单
SET /P B8= 重建默认:%WZ1% 按任意键开始.....回车:
if /I "%B8%"=="e" goto MENU
wimlib-imagex optimize %WZ% --check
PAUSE
GOTO MENU
:UU
SET sn1=1
SET XX2=1
for /l %%i in (1,1,100) do (
IF NOT EXIST %DIRSD%\YP%%i GOTO PASS49
set /a sn1=%%i+1
)
:PASS49
SET XX2=%sn1%
IF %UP% equ 关闭Y: (
SET UP=开启Y:
IF NOT EXIST %DIRSD%\YP%XX2%\ MD %DIRSD%\YP%XX2%\
SUBST.EXE Y: %DIRSD%\YP%XX2%\
) ELSE (
SET UP=关闭Y:
SUBST.EXE Y: /D
)
GOTO MENU
:GHWZ
IF %WE% equ ESD SET WE=WIM & SET YS=--compress=XPRESS & GOTO GHWZ1
IF %WE% equ SNA SET WE=TBI & SET YS=COMP:15 & GOTO GHWZ1
IF %WE% equ WIM SET WE=SNA & SET YS= & GOTO GHWZ1
IF %WE% equ TBI SET WE=ESD & SET YS=--compress=LZX:20 & GOTO GHWZ1
:GHWZ1
SET WZ1=%SNADIR%SYSC%XX1%.%WE%
SET WZ=%SNADIR%SYSC%XX1%.%WE%
SET NM=OKK
GOTO MENU
:RR
TYPE %CK% | MORE
PAUSE
GOTO MENU
:ZZ
SET NM=OFFN
SET NNN=9
SET BPF09=1
ECHO.搜索文件中.......请等待......
IF EXIST X.TXT DEL X*.TXT
DIR "%DIRSDWJ%\*.%WE%" /S /B >X.TXT
for /f "delims=" %%a in ("X.txt") do if %%~za equ 0 PAUSE & GOTO MENU
FIND /N "%DIRSDWJ%\" X.TXT >X1.TXT
for /f "tokens=*" %%a in (X1.TXT) do @echo %%a|find /v /i "---">>X2.TXT
TYPE X2.TXT
SET /P BPF09=默认:%BPF09%请输入第几个文件号[数字]回车:
ECHO. 按任意键选定文件
:APASS
For /f "delims=" %%i in ( 'Type X2.TXT^|Find "[%BPF09%]"' ) do (Echo %%i>X3.TXT)
SET /P SAA=<./X3.TXT
IF %BPF09% LEQ %NNN% (
SET /P SAA1=%SAA:~3,200%>X4.TXT
) ELSE (
SET /P SAA1=%SAA:~4,200% >X4.TXT
)
for /f %%i in (X4.TXT) do SET PF=%%~di
for /f %%i in (X4.TXT) do SET LJ=%%~pi
SET LJ1=%LJ:~0,8%...\
for /f %%i in (X4.TXT) do SET WJ=%%~ni
for /f %%i in (X4.TXT) do SET KZ=%%~xi
GOTO MENU
:CC5
SET NM=OKK
for %%b in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
IF exist %%b: SET k1=%%b
)
SET BPF6=%DIRSDWJ%
SET /P BPF6= 默认:备份存储%DIRSD%盘 请输入备份存储盘: (请输入C-%K1%)字母回车:
IF %BPF6%==%DIRSDWJ% GOTO MENU
SET DIRSDWJ=%BPF6%:
GOTO MENU
:QQ
shutdown -r -t 0
EXIT
:XX
SET NM=OKK
SET sn=1
for /l %%i in (1,1,10) do (
IF NOT EXIST %SNADIR%SYSC%%i.%WE% GOTO PASS50
set /a sn=%%i+1
)
:PASS50
IF NOT EXIST %SNADIR%SYSC%XX1%.%WE% SET sn=1
SET XX1=%sn%
SET /P XX1= 请输入完整备份文件号 默认:SYSC%XX1%.%WE%(默认第%XX1%个完整备份 请输入1-9数字)回车:
ECHO. 选择的是SYSC%XX1%.%WE% 文件
SET WZ1=%SNADIR%SYSC%XX1%.%WE%
SET WZ=%SNADIR%SYSC%XX1%.%WE%
SET Bn=%XX1%
CLS
GOTO MESSS
:YY
ECHO.压缩率选项如下:
IF %WE% equ SNA SET YS= & GOTO MENU
IF %WE% equ TBI GOTO TTBI
IF %WE% equ TBI GOTO TTBI
IF %WE% equ ESD GOTO EESD
IF %WE% equ WIM GOTO WWIM
:EESD
echo.1.--compress=LZX:20 4.--compress=LZMS 7.--compress=XPRESS
echo.2.--compress=LZX 5.--compress=none 8.--compress=XPRESS:80
echo.3.--compress=LZX:100 6.--wimboot 9.--solid
SET /P YS= 请输入压缩模式 默认:%YS%(1-9)数字回车:
if /I "%YS%"=="1" SET YS=--compress=LZX:20
if /I "%YS%"=="2" SET YS=--compress=LZX
if /I "%YS%"=="3" SET YS=--compress=LZX:100
if /I "%YS%"=="4" SET YS=--compress=LZMS
if /I "%YS%"=="5" SET YS=--compress=none
if /I "%YS%"=="6" SET YS=--wimboot
if /I "%YS%"=="7" SET YS=--compress=XPRESS
if /I "%YS%"=="8" SET YS=--compress=XPRESS:80
if /I "%YS%"=="9" SET YS=--solid
GOTO MENU
EXIT
:WWIM
echo.1.--compress=LZX:20 4.--compress=LZMS 7.--compress=XPRESS
echo.2.--compress=LZX 5.--compress=none 8.--compress=XPRESS:80
echo.3.--compress=LZX:100 6.--wimboot 9.--solid
SET /P YS= 请输入压缩模式 默认:%YS%(1-9)数字回车:
if /I "%YS%"=="1" SET YS=--compress=LZX:20
if /I "%YS%"=="2" SET YS=--compress=LZX
if /I "%YS%"=="3" SET YS=--compress=LZX:100
if /I "%YS%"=="4" SET YS=--compress=LZMS
if /I "%YS%"=="5" SET YS=--compress=none
if /I "%YS%"=="6" SET YS=--wimboot
if /I "%YS%"=="7" SET YS=--compress=XPRESS
if /I "%YS%"=="8" SET YS=--compress=XPRESS:80
if /I "%YS%"=="9" SET YS=--solid
GOTO MENU
EXIT
:TTBI
echo.1.comp:1 4.comp:10 7.comp:13
echo.2.comp:2 5.comp:11 8.comp:15
echo.3.comp:7 6.comp:12 9.comp:0
SET /P YS= 请输入压缩模式 默认:%YS%(1-9)数字回车:
if /I "%YS%"=="1" SET YS=comp:1
if /I "%YS%"=="2" SET YS=comp:2
if /I "%YS%"=="3" SET YS=comp:7
if /I "%YS%"=="4" SET YS=comp:10
if /I "%YS%"=="5" SET YS=comp:11
if /I "%YS%"=="6" SET YS=comp:12
if /I "%YS%"=="7" SET YS=comp:13
if /I "%YS%"=="8" SET YS=comp:15
if /I "%YS%"=="9" SET YS=comp:0
GOTO MENU
EXIT
:NN
CMD /C "ECHO LIST VOL"|DISKPART
ECHO. 隐藏 ESP分区
ECHO.------------------------------
set /p v=请选择ESP分区的卷号(0-9数字:%v%) 然后按回车:
cmd /c "echo select vol %v% & echo remove & echo list vol"|diskpart
ECHO. 已经卸载ESP分区盘符
ECHO. 隐藏ESP分区盘符,便于保护引导区文件,不被修改!!!
ECHO.-----------------------------------------------------------
SET ES=C:
PAUSE
GOTO MENU
:BPFE1
for %%b in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
IF exist %%b: SET k1=%%b
)
SET BPF0=C
SET /P BPF0= 请输入关联ESP-分区对应的WINDOWS盘符 默认C:盘 (请输入C-%K1%)字母回车:
SET BPFE=%BPF0%:
GOTO MENU
:ES1
CLS
CMD /C "ECHO LIST VOL"|DISKPART
ECHO. 挂载 ESP分区
ECHO.------------------------------
set /p v=请选择ESP分区的卷号(0-9数字:%v%) 然后按回车:
cmd /c "echo select vol %v% & echo assign & echo list vol"|diskpart
ECHO. 已经分配 ESP分区盘符
for %%b in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
IF exist %%b: SET k1=%%b
)
SET BPF1=C
SET /P BPF1= 请输入ESP分区挂载的盘符 默认C:盘 (请输入C-%K1%)字母回车:
SET ES=%BPF1%:
GOTO MENU
:BPFB
IF %WE% equ TBI GOTO MENU
for %%b in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
IF exist %%b: SET k1=%%b
)
SET BPF1=C
SET /P BPF1= 请输入需要备份目标盘符 默认C:盘 (请输入C-%K1%)字母回车:
SET BPFB=%BPF1%:
GOTO MENU
:BPFH1
IF %WE% equ TBI GOTO MENU
for %%b in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
IF exist %%b: SET k1=%%b
)
SET BPF2=C
SET /P BPF2= 请输入需要恢复目标盘符 默认C:盘 (请输入C-%K1%)字母回车:
SET BPFH=%BPF2%:
IF /I %BPFH% equ %DIRSD% (
ECHO. 与备份盘一致重新选择盘符
GOTO BPFH1
)
GOTO MENU
:XZ
set syspart=%BPFE%
set rootpart=%ES%
set sect=n
echo. 默认ESP分区%ES%盘 关联ESP-分区对应的Windows盘符为 %BPFE%盘 默认固件类型:%bios%
set /p bios=按E键-返回主菜单 请输入"固件类型",可选uefi,bios 默认%bios%类型:
if /I "%bios%"=="e" goto MENU
bcdboot.exe %syspart%\windows /s %rootpart% /f %bios% /l zh-cn
if /I "%bios%"=="uefi" (
copy "%windir%\Boot\DVD\EFI\boot.sdi" "%rootpart%\EFI\Microsoft\Boot\">nul
if exist %rootpart%\EFI\boot\zh-CN rd /s /q %rootpart%\EFI\boot\zh-CN
md %rootpart%\EFI\boot\zh-CN
copy "%rootpart%\EFI\Microsoft\Boot\zh-CN\bootmgfw.efi.mui" "%rootpart%\EFI\Boot\zh-CN\">nul
if %processor_architecture%==X86 (
ren %rootpart%\EFI\Boot\zh-CN\bootmgfw.efi.mui bootia32.efi.mui
) else (
ren %rootpart%\EFI\Boot\zh-CN\bootmgfw.efi.mui bootx64.efi.mui )
)
if /I "%bios%"=="bios" (
copy "%windir%\Boot\DVD\PCAT\boot.sdi" "%rootpart%\Boot\">nul
set /p sect=是否将引导写入扇区,是请输入“y”:
)
if /I "%sect%"=="y" (
cmd /c bootsect.exe /nt60 %rootpart% /force
cmd /c bootsect.exe /nt60 %rootpart% /mbr /force
)
ECHO. 已经--修复ESP分区引导
ECHO.------------------------------
PAUSE
GOTO MENU
:KSK
IF "%KK%"=="--wimboot" (SET KK=OFF1
) ELSE (
SET KK= --wimboot
)
GOTO MENU
EXIT
:SC
SET ST7=%Hn%
IF %WE% equ SNA SET WZ1=%SNADIR%SYSC%ST7%.%WE%
IF %WE% equ TBI SET WZ1=%SNADIR%SYSC%ST7%.%WE%
ECHO.按E键-返回主菜单
SET /P ST7=默认删除%WZ1%(默认第%Hn%个备份 输入1-%Hn%数字)回车:
if /I "%ST7%"=="e" goto MENU
IF %WE% equ TBI (
del %SNADIR%SYSC%ST7%.TBI /F /Q & del %SNADIR%SYSC%ST7%.#* /F /Q
IF "%ST7%"=="1" SET Hn=0 & SET Bn=1
GOTO MENU
)
IF %WE% equ SNA (
IF NOT EXIST %SNADIR%SYSC%ST7%.SNA GOTO MENU
IF "%ST7%"=="1" (
del %SNADIR%SYSC1.SNA /F /Q
del %SNADIR%SYSC1.HSH /F /Q
SET Hn=0 & SET Bn=1
GOTO MENU
) ELSE (
del %SNADIR%SYSC%ST7%.SNA /F /Q
GOTO MENU
)
GOTO MENU
)
IF "%ST7%"=="1" del %SNADIR%SYSC%ST7%.%WE% /F /Q
IF EXIST %WZ% "wimlib-imagex.exe" delete %WZ% %Hn% --soft
PAUSE
GOTO MENU
:winbackup
SET ST0=0
SET ST9=%Bn%
IF %WE% equ WIM IF NOT EXIST %WZ% GOTO BACKUP1
IF %WE% equ ESD IF NOT EXIST %WZ% GOTO BACKUP1
IF %WE% equ SNA IF NOT EXIST %SNADIR%SYSC1.SNA GOTO BACKUP1
IF %WE% equ TBI IF NOT EXIST %SNADIR%SYSC1.TBI GOTO BACKUP1
if /I "%ST1%"=="BF" goto WACKBB
:WBACKUP
ECHO.按E键-返回主菜单
echo.备份%BPFB%盘 默认备份为第%Bn%个备份 输入1即覆盖更新完整备份
SET /P ST0=默认备份%WZ1%(默认第%Bn%个备份 按任意键开始备份)回车:
if /I "%ST0%"=="1" goto BACKUP1
if /I "%ST0%"=="e" goto MENU
:WACKBB
IF %WE% equ TBI SET WZ1=%SNADIR%SYSC%ST9%.TBI & SET WZ=%SNADIR%SYSC%ST9%.TBI
IF %WE% equ TBI imagew64.exe /wait /b /uy /base:"%SNADIR%SYSC1.TBI" /f:"%WZ%" /skh:0 /skuj:0 /%YS% /noej /log:0 & GOTO MENU
IF %WE% equ SNA "Snapshot64.exe" %BPFB% %SNADIR%SYSC%ST9%.SNA -R -Gx -L0 -H%SNADIR%SYSC1.HSH -Y & GOTO MENU
if /i %BPFB% neq C: "wimlib-imagex.exe" append %BPFB%\ %SNADIR%SYSC%XX1%.%WE% %ST9% %ST9% & GOTO MENU
IF EXIST "X:\WINDOWS\" "wimlib-imagex.exe" append %BPFB%\ %SNADIR%SYSC%XX1%.%WE% %ST9% %ST9%
IF NOT EXIST "X:\WINDOWS\" "wimlib-imagex.exe" append %BPFB%\ %SNADIR%SYSC%XX1%.%WE% %ST9% %ST9% --snapshot
GOTO MENU
exit
:BACKUP1
SET ST0=0
IF %WE% equ SNA SET WZ1=%SNADIR%SYSC1.SNA & SET WZ=%SNADIR%SYSC1.SNA
IF %WE% equ TBI SET WZ1=%SNADIR%SYSC1.TBI & SET WZ=%SNADIR%SYSC1.TBI
if /I "%ST1%"=="BF" goto WACKBB1
ECHO.按E键-返回主菜单 备份%BPFB%盘 参数boot%BOO%
SET /P ST0=默认备份%WZ1%回车:
if /I "%ST0%"=="e" goto MENU
:WACKBB1
IF %WE% equ SNA "Snapshot64.exe" %BPFB% %SNADIR%SYSC1.SNA -R -Gx -L0 -Y & GOTO MENU
IF %WE% equ TBI (
IF /I "%bios%"=="uefi" (
IF /I %TBIC% equ C3 imagew64.exe /wait /b /uy /d:w0@0X3 /f:"%WZ%" /skh:0 /skuj:0 /%YS% /noej /hash /log:0 & GOTO MENU
IF /I %TBIC% equ C2 imagew64.exe /wait /b /uy /d:w0@0X2 /f:"%WZ%" /skh:0 /skuj:0 /%YS% /noej /hash /log:0 & GOTO MENU
)
IF /I "%bios%"=="bios" imagew64.exe /wait /b /uy /d:w0@0X1 /f:"%WZ%" /skh:0 /skuj:0 /%YS% /noej /hash /log:0 & GOTO MENU
)
IF %BOO% equ 开启 (
if /i %BPFB% equ Y: "wimlib-imagex.exe" capture %DIRSD%\YP%XX2%\ %WZ% --compress=LZX:20 --boot --check & GOTO MENU
if /i %BPFB% neq C: "wimlib-imagex.exe" capture %BPFB%\ %WZ% --compress=LZX:20 --boot --check & GOTO MENU
IF EXIST "X:\WINDOWS\" "wimlib-imagex.exe" capture %BPFB%\ %WZ% --compress=LZX:20 --boot --check & GOTO MENU
IF NOT EXIST "X:\WINDOWS\" "wimlib-imagex.exe" capture %BPFB%\ %WZ% --snapshot --compress=LZX:20 --boot --check & GOTO MENU
)
if /i %BPFB% neq C: "wimlib-imagex.exe" capture %BPFB%\ %WZ% 1 1 %YS% --check & PAUSE & GOTO MENU
if %WE% equ ESD (
IF EXIST "X:\WINDOWS\" "wimlib-imagex.exe" capture %BPFB%\ %WZ% 1 1 %YS% --check
IF NOT EXIST "X:\WINDOWS\" "wimlib-imagex.exe" capture %BPFB%\ %WZ% 1 1 --snapshot %YS% --check
) ELSE (
IF EXIST "X:\WINDOWS\" "wimlib-imagex.exe" capture %BPFB%\ %WZ% 1 1 %YS% --check
IF NOT EXIST "X:\WINDOWS\" "wimlib-imagex.exe" capture %BPFB%\ %WZ% 1 1 --snapshot %YS% --check
)
GOTO MENU
EXIT
:winrecover
SET ST0=0
SET ST4=%Hn%
IF %WE% equ TBI SET WZ1=%SNADIR%SYSC%ST4%.TBI & SET WZ=%SNADIR%SYSC%ST4%.TBI
IF %WE% equ SNA SET WZ1=%SNADIR%SYSC%ST4%.SNA & SET WZ=%SNADIR%SYSC%ST4%.SNA
if /I "%ST1%"=="HF" goto WCOVER
ECHO.按E键-返回主菜单
echo.恢复C:盘请进入PE中恢复系统 恢复到%BPFH%盘 参数wimboot%KK1%
SET /P ST0=默认恢复%WZ1%(默认第%Hn%个备份 按任意键开始恢复)回车:
if /I "%ST0%"=="e" goto MENU
:WCOVER
IF %WE% equ SNA (
SET WZ1=%SNADIR%SYSC%ST4%.SNA
SET WZ=%SNADIR%SYSC%ST4%.SNA
IF NOT EXIST %SNADIR%SYSC1.SNA GOTO MENU
IF EXIST "X:\WINDOWS\" snapshot64 %WZ% %BPFH% -Y -Gx & shutdown -r -t 0
snapshot64 --schedule %BPFH% %WZ% --autoreboot:any
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Snapshot" /f /v "AutoReboot" /t REG_DWORD /d 1
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Snapshot" /f /v "AutoRebootSuccess" /t REG_DWORD /d 0
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Snapshot" /f /v "Timeout" /t REG_DWORD /d 3
shutdown -r -t 0
)
IF %WE% equ TBI (
SET WZ1=%SNADIR%SYSC%ST4%.TBI & SET WZ=%SNADIR%SYSC%ST4%.TBI
IF NOT EXIST %SNADIR%SYSC1.TBI GOTO MENU
IF /I "%bios%"=="uefi" (
IF /I %TBIC% equ C3 imagew64.exe /wait /r /x /uy /d:w0@0X3 /f:"%WZ%" /noej /err /log:0 & GOTO MENU
IF /I %TBIC% equ C2 imagew64.exe /wait /r /x /uy /d:w0@0X2 /f:"%WZ%" /noej /err /log:0 & GOTO MENU
) ELSE (
IF /I "%bios%"=="bios" imagew64.exe /wait /r /x /uy /d:w0@0X1 /f:"%WZ%" /noej /err /log:0 & GOTO MENU
)
)
if /i %BPFH% neq C: goto PSS
IF NOT EXIST "X:\WINDOWS\" GOTO MENU
:PSS
IF NOT EXIST %WZ% GOTO MENU
FORMAT %BPFH% /Q /Y
IF "%KK%"=="--wimboot" (
"wimlib-imagex.exe" apply %WZ% %ST4% %BPFH% --wimboot
) ELSE (
"wimlib-imagex.exe" apply %WZ% %ST4% %BPFH%
)
GOTO MENU
:MENU1
CLS
echo. 备份恢复分区表!警告-警告-警告!!!慎重操作!!!
echo. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
echo. 1. 备份--硬盘分区表
echo.
echo. 2. 备份硬盘分区表--U盘
echo.
echo. 3. 手动启动BOOTICE-备份恢复分区表
echo.
echo. E. 退出
echo. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
set choice=1
set /p choice= 请选择要进行的操作(默认为:%choice%) 然后按回车:
if /i "%choice%"=="1" goto MBR0
if /i "%choice%"=="2" goto MBRU
if /i "%choice%"=="3" goto MBR1
if /i "%choice%"=="e" goto MENU
EXIT
:MBRU
ECHO.--------------------------------------------
echo. 备份分区表!分区表文件存储在%SNADIR%01.DPT
ECHO. 备份-硬盘分区表存储到U盘
ECHO.--------------------------------------------
set /p rootpart=请输入“U盘符”[字母]回车:
BOOTICE.EXE /DEVICE=0 /PARTITIONS /BACKUP_DPT=01.DPT /QUIET
COPY 01.DPT %rootpart%:\ /y
ECHO. 已经保存 硬盘分区表到目标盘:%rootpart%:盘 中.....
ECHO.------------------------------------------------------
PAUSE
GOTO MENU1
EXIT
:MBR0
ECHO.------------------------------------------------
echo. 备份硬盘分区表!分区表文件存储在%SNADIR%01.DPT
ECHO.------------------------------------------------
BOOTICE.EXE /DEVICE=0 /PARTITIONS /BACKUP_DPT=01.DPT /QUIET
COPY BOOTICE.EXE %SNADIR% /Y
COPY 01.DPT %SNADIR% /Y
ECHO.------------------------------
PAUSE
GOTO MENU1
EXIT
:MBR1
ECHO.------------------------------------------
echo. 手动备份恢复分区表!BOOTICE-分区管理
ECHO.------------------------------------------
PAUSE
BOOTICE.EXE /DEVICE=0
GOTO MENU1
EXIT
:folderopen
DIR %SNADIR%
pause
GOTO MENU5
exit
已更新5.3.1 优化TBI定位代码。定版
已上传网盘 算是ESD,WIM,SNA,TBI 集合版
下载 123pan.com/s/WtyA-yig0.html
用的好,帮助上传一下软件界面图片
|
评分
-
查看全部评分
|