|
楼主是要这个批处理吧,帮你找来了。
http://bbs.wuyou.net/forum.php?m ... p;page=2#pid1246222
@Echo Off
COLOR 2F
Set Prog= WinPE 专用安装工具
Set L1= ╭══════════════════╮
Set L2= ║ ║
Set L3= ╭══┤ %Prog% ├══╮
Set L4= ║ ║ ║ ║
Set L5= ║ ╰══════════════════╯ ║
Set L6= ║ ║
Set L7= ╟════════════════════════╢
Set L8= ║ ║
Set L9= ╰────────────────────────╯
Title %Prog%
FOR /F "delims=" %%I in (%0) do Set CP=%%~dpI
Set SetupINIFile=PESetup.INI
Set PEFile=MiniPE\WinPE.IS_
Set PEIni=MiniPE\WinPE.INI
Set LogFile=PEInstall.log
If Not Exist .\PESETUP.INI Goto Err0
For /F "tokens=2 delims=^=" %%I In ('FIND /I ^"外置程序包^" .\%SetupINIFile%') DO Set OPFile=MiniPE\%%I
Set AddATTR=ATTRIB +S +H +R
Set DelATTR=ATTRIB -S -H -R
:Start
CLS
Title %Prog%——安装
Echo.
Echo %L1%
Echo %L2%
Echo %L3%
Echo %L4%
Echo %L5%
Echo %L6%
Echo ║ 请选择安装方式: ║
Echo %L6%
Echo ║ [1] 普通安装/启动 (硬盘安装) ║
Echo ║ [2] Grub安装/启动 (硬盘安装,支持 MD5 密码) ║
Echo ║ [3] Aero安装/启动 (硬盘安装,支持密码) ║
Echo ║ [4] Grub安装/启动 (U 盘、移动硬盘安装) ║
Echo ║ [Q] 退出安装 ║
Echo %L6%
Echo %L7%
Echo ║ 注意: Aero 安装项只适合系统分区在(HD0,0)分区 ║
Echo %L7%
Echo %L8%
Echo %L9%
Echo.
Set Choice=
Set /P Choice= 请选择要进行的操作 (1/2/3/4/Q) ,然后按回车:
If "%Choice%"=="" Goto Start
If Not "%Choice%"=="" Set Choice=%Choice:~0,1%
If /I "%Choice%"=="1" Goto HD
If /I "%Choice%"=="2" Goto HD
If /I "%Choice%"=="3" Goto HD
If /I "%Choice%"=="4" Goto UD
If /I "%Choice%"=="Q" Exit
Goto Start
:HD
Set RP=
For %%I In (Z Y X W V U T S R Q P O N M L K J I H G F E D C) Do If Exist %%I:\BOOT.INI Set RP=%%I:
If "%RP%"=="" Goto HDRPErr
Set PEDIR=%RP%\MiniPE&&Set TargetP=硬盘&&Set TxtSp=
If Exist %PEDIR% Goto Err1
FIND /I "C:\MAOTAO" %RP%\BOOT.INI>NUL 2>NUL
If "%Errorlevel%"=="0" Goto Err1
FIND /I "C:\MiniPE" %RP%\BOOT.INI>NUL 2>NUL
If "%Errorlevel%"=="0" Goto Err1
If /I "%Choice%"=="1" Goto Install
If /I "%Choice%"=="2" Goto GInstall
If /I "%Choice%"=="3" Goto AInstall
Goto HD
:UD
CLS
Title %Prog%——U 盘安装
For /F "skip=2 tokens=*" %%I In ('MYINS\CHECKUSB.EXE') DO SET Us=%%I
If "%Us%"=="当前可移动磁盘分区:" Goto NoUD
Echo %Us%&&Echo.
If "%NoUD%"=="Yes" Echo 错误:您设定的分区 %RP% 不存在、写保护、未格式化或不是 U 盘分区,请按任意键重新设定。&&Echo.
Set /P RP=请选择您的 U 盘盘符(不需要冒号,例如 F):
Echo.&&Echo.
If "%RP%"=="" Goto UD
If Not "%RP%"=="" Set RP=%RP:~0,1%:
For /F %%I In ('MYINS\CHECKUSB.EXE %RP%') DO SET Err2=%%I
If Not "%Err2%"=="1" Set NoUD=Yes&&Goto UD
Set TestFile=%RP%\MiniPETest_%RANDOM%.MT
Cd.>%TestFile%
If Not Exist %TestFile% Set NoUD=Yes&&Goto UD
FOR /F "delims=" %%I in (%0) do Set TP=%%~dI
Del %TestFile% /Q>NUL 2>NUL
for %%i in (A B 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 call set rp=%%rp:%%i=%%i%%
If Not "%RP%"=="" Set RP=%RP:~0,1%:
if "%TP%"=="%RP%" goto DBU
Set U=U&&Set PEDIR=%RP%\MiniPE&&Set TargetP= U 盘&&Set TxtSp=
If Exist %RP%\MAOTAO Goto Err1
If Exist %PEDIR% Goto Err1
CLS
Echo 您选择的 U 盘分区为 %RP%,下面将对您的 U 盘进行格式化并写入引导
Echo.
Echo 请严格按照相关工具软件界面中的提示操作,以防出错。请按任意键开始。。。
PAUSE>NUL
Start /Wait MYINS\HPUSBFW.EXE
Start /Wait MYINS\GRUBGUI.EXE
cls
echo 请稍候,正在安装中......
Echo.
md %rp%\SETUP\MYINS >NUL 2>NUL
md %rp%\MINIPE >NUL 2>NUL
md %rp%\SETUP\TOOLS >NUL 2>NUL
copy myins\aero.sys %rp%\setup\myins >NUL 2>NUL
copy myins\checkusb.exe %rp%\setup\myins >NUL 2>NUL
copy myins\grubgui.exe %rp%\setup\myins >NUL 2>NUL
copy myins\grubinst.exe %rp%\setup\myins >NUL 2>NUL
copy myins\hpusbfw.exe %rp%\setup\myins >NUL 2>NUL
copy myins\md5.exe %rp%\setup\myins >NUL 2>NUL
copy myins\myins.dll %rp%\setup\myins >NUL 2>NUL
copy myins\myins.exe %rp%\setup\myins >NUL 2>NUL
copy myins\ntboot.exe %rp%\setup\myins >NUL 2>NUL
copy pesetup.ini %rp%\setup >NUL 2>NUL
copy pesetup.cmd %rp%\setup >NUL 2>NUL
copy tools\BMP2COVE.exe %rp%\setup\tools >NUL 2>NUL
copy tools\WIMTOOL.EXE %rp%\setup\tools >NUL 2>NUL
copy tools\MD5CRYPT.rar %rp%\setup\tools >NUL 2>NUL
copy tools\WIMFS.exe %rp%\setup\tools >NUL 2>NUL
copy tools\WIMGAPI.DLL %rp%\setup\tools >NUL 2>NUL
copy tools\WIMGAPI.PAS %rp%\setup\tools >NUL 2>NUL
Echo 您的 U 盘已经成功格式化并写入了 Grub 引导,请按任意键继续......
PAUSE>NUL
Goto GInstall
:DBU
echo ------------------------------------------------------------------
ECHO 您选择的安装盘符与目标盘符重复,不需要再安装。请选择其它的安装方式
echo ------------------------------------------------------------------
pause
goto start
:NoUD
CLS
Title %Prog%——U 盘安装
Echo.
Echo %L1%
Echo %L2%
Echo %L3%
Echo %L4%
Echo %L5%
Echo %L6%
Echo ║ 您的计算机似乎没有安装 U 盘,您想怎么办? ║
Echo %L6%
Echo ║ [B] 返回首页,重新选择安装选项。 ║
Echo ║ [Q] 退出安装 ║
Echo %L6%
Echo %L7%
Echo %L8%
Echo %L9%
Echo.
Set Choice=
Set /P Choice= 请选择要进行的操作 (B/Q) ,然后按回车:
If "%Choice%"=="" Goto NoUD
If Not "%Choice%"=="" Set Choice=%Choice:~0,1%
If /I "%Choice%"=="B" Goto Start
If /I "%Choice%"=="Q" Exit
Goto NoUD
Exit
:Err0
Echo 错误:安装配置文件丢失!&&Echo.
Echo 请确认安装配置文件 %SetupINIFile% 存在或到本程序所在目录执行安装。&&Echo.
Echo 请按任意键退出安装程序。。。
PAUSE>NUL
Exit
:Err1
CLS
Title %Prog%——卸载
Echo.
Echo %L1%
Echo %L2%
Echo %L3%
Echo %L4%
Echo %L5%
Echo %L6%
Echo ║ 您的%TargetP%中好像已经安装了 WinPE,您想怎么办?%TxtSp% ║
Echo %L6%
Echo ║ [1] 卸载原有的 WinPE,并且重新安装。 ║
Echo ║ [2] 卸载原有的 WinPE,并且不再安装。 ║
Echo ║ [B] 返回首页,重新选择安装选项。 ║
Echo ║ [Q] 退出安装 ║
Echo %L6%
Echo %L7%
Echo %L8%
Echo %L9%
Echo.
Set Choice=
Set /P Choice= 请选择要进行的操作 (1/2/B/Q) ,然后按回车:
If "%TargetP%"=="硬盘" Set U=
If "%Choice%"=="" Goto Err1
If Not "%Choice%"=="" Set Choice=%Choice:~0,1%
If /I "%Choice%"=="1" Set Choi=1&&Goto UnInstall
If /I "%Choice%"=="2" Goto UnInstall
If /I "%Choice%"=="B" Goto Start
If /I "%Choice%"=="Q" Exit
Goto Err1
Exit
:UnInstall
If Exist %RP%\LDRXPE %DelATTR% %RP%\LDRXPE&&Del %RP%\LDRXPE /Q>NUL 2>NUL
If Exist %RP%\WINNT.XPE %DelATTR% %RP%\WINNT.XPE&&Del %RP%\WINNT.XPE /Q>NUL 2>NUL
If Exist %RP%\MTLDR.PE %DelATTR% %RP%\MTLDR.PE&&Del %RP%\MTLDR.PE /Q>NUL 2>NUL
If Exist %RP%\MTLDR %DelATTR% %RP%\MTLDR&&Del %RP%\MTLDR /Q>NUL 2>NUL
If Exist %RP%\%LogFile% For /F "eol=; tokens=2 delims=^=" %%i In ('find /I ^"WinPE外挂位置^" %RP%\%LogFile%') do SET OPD=%%i
If Not "%U%"=="" Set OPD=%RP%
If Exist %OPD%\外置程序 RD %OPD%\外置程序 /S /Q>NUL 2>NUL
If Exist %RP%\%LogFile% %DelATTR% %RP%\%LogFile%&&Del %RP%\%LogFile% /Q>NUL 2>NUL
If Exist %RP%\MAOTAO RD %RP%\MAOTAO /S /Q>NUL 2>NUL
If Exist %RP%\MiniPE RD %RP%\MiniPE /S /Q>NUL 2>NUL
%DelATTR% %RP%\BOOT.INI>NUL 2>NUL
Set TMPINIFile=BOOT_%RANDOM%.INI
If Exist %RP%\BOOT.BAK (
%DelATTR% %RP%\BOOT.BAK
TYPE %RP%\BOOT.BAK|FIND /I /V "C:\MAOTAO">%RP%\%TMPINIFile%
TYPE %RP%\%TMPINIFile%|FIND /I /V "C:\MiniPE">%RP%\BOOT.INI
) Else (
If Exist %RP%\BOOT.INI TYPE %RP%\BOOT.INI|FIND /I /V "C:\MAOTAO">%RP%\%TMPINIFile%
If Exist %RP%\%TMPINIFile% TYPE %RP%\%TMPINIFile%|FIND /I /V "C:\MiniPE">%RP%\BOOT.INI
)
If Exist %RP%\BOOT.BAK %DelATTR% %RP%\BOOT.BAK&&Del %RP%\BOOT.BAK>NUL 2>NUL
If Exist %RP%\%TMPINIFile% %DelATTR% %RP%\%TMPINIFile%&&Del %RP%\%TMPINIFile%>NUL 2>NUL
If Exist %RP%\BOOT.INI %AddATTR% %RP%\BOOT.INI
Set RP=
Title %Prog%——卸载完成
If "%Choi%"=="1" (Echo.&&Echo.&&Echo 卸载完成,请按任意键准备安装 。。。&&PAUSE>NUL 2>NUL&&Goto Start)
Echo.&&Echo.&&Echo 卸载完成,请按任意键退出 。。。
PAUSE>NUL 2>NUL
Exit
:Install
Title %Prog%——普通安装
If Not Exist %PEDIR% MD %PEDIR%>NUL 2>NUL
If Exist %RP%\LDRXPE %DelATTR% %RP%\LDRXPE
If Exist %RP%\WINNT.XPE %DelATTR% %RP%\WINNT.XPE
Echo.&&Echo 正在复制文件,请稍候 。。。
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% MAOTAO.BIN -r -y>NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% PE -r -y>NUL 2>NUL
Call :CopyAndSetFiles
Goto SUCCESS
:GInstall
If "%U%"=="" Title %Prog%——Grub安装
CLS
Set LDRP=MiniPE\
Echo 请输入您要设定的密码
Echo 注意:密码中不许有空格、"\"、引号等特殊字符
Echo.
Set /P Pass1=请输入:
If "%Pass1%"=="" Goto GInstall
Echo.&&Echo.
Echo 请再一次输入您的密码
Echo.
Set /P Pass2=请再次输入:
If "%Pass2%"=="" Goto GInstall
If Not "%Pass2%"=="%Pass1%" Echo.&&Echo 您两次输入的密码不一致,请重新输入&&Echo 请按任意键重新开始设置密码&&PAUSE>NUL 2>NUL&&Goto GInstall
If Not Exist %PEDIR% MD %PEDIR%>NUL 2>NUL
>%PEDIR%\MD5P.TMP <nul Set/p=%Pass2%
MYINS\MD5.EXE %PEDIR%\MD5P.TMP %PEDIR%\MD5R.TXT>NUL 2>NUL
For /f %%i In ('type %PEDIR%\md5r.txt') do SET MD5Pass=password --md5 %%i
MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% MTLDR -r -y>NUL 2>NUL
>>%RP%\MTLDR Echo %MD5Pass%
>>%RP%\MTLDR Echo fontfile /minipe/muifont.gz
>>%RP%\MTLDR Echo splashimage /minipe/bj2008.xpm.gz
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title WinPE 迷你维护系统
>>%RP%\MTLDR Echo %MD5Pass%
>>%RP%\MTLDR Echo chainloader /minipe/ldrxpe
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title Grub 命令行
>>%RP%\MTLDR Echo %MD5Pass%
>>%RP%\MTLDR Echo commandline
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 从第一硬盘第一分区启动
>>%RP%\MTLDR Echo root ^(hd0,0^)
>>%RP%\MTLDR Echo chainloader +1
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 从第二硬盘第一分区启动
>>%RP%\MTLDR Echo root ^(hd1,0^)
>>%RP%\MTLDR Echo chainloader ^(hd1,0^)+1
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 重新启动计算机
>>%RP%\MTLDR Echo reboot
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 关闭计算机
>>%RP%\MTLDR <nul Set/p=halt
Del %PEDIR%\MD5?.* /Q>NUL 2>NUL
Echo.
Echo 密码设置完成,请牢记您的密码,并按任意键继续 。。。
PAUSE>NUL 2>NUL
If Exist %RP%\LDRXPE %DelATTR% %RP%\LDRXPE
If Exist %RP%\WINNT.XPE %DelATTR% %RP%\WINNT.XPE
If Exist %RP%\MTLDR %DelATTR% %RP%\MTLDR
Echo.
Echo 正在复制文件,请稍候 。。。
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% BJ2008.XPM.GZ -r -y >NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% muifont.gz -r -y >NUL 2>NUL
If "%U%"=="" MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR%\ maotaog.bin -r -y >NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% PE -r -y >NUL 2>NUL
If "%U%"=="" Ren %PEDIR%\maotaog.bin maotao.bin >NUL 2>NUL
Call :CopyAndSetFiles
Goto SUCCESS
:AInstall
Title %Prog%——Aero安装
CLS
Echo 请输入您要设定的密码
Echo 注意:密码中不许有空格、"\"、引号等特殊字符
Echo.
Set /P Pass1=请输入:
If "%Pass1%"=="" Goto AInstall
Echo.&&Echo.
Echo 请再一次输入您的密码
Echo.
Set /P Pass2=请再次输入:
If "%Pass2%"=="" Goto AInstall
If Not "%Pass2%"=="%Pass1%" Echo.&&Echo 您两次输入的密码不一致,请重新输入&&Echo 请按任意键重新开始设置密码&&PAUSE>NUL 2>NUL&&Goto AInstall
If Not Exist %PEDIR% MD %PEDIR%>NUL 2>NUL
For /f %%i In (MyIns\Aero.sys) Do MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% %%i -r -y>NUL 2>NUL
Ren %PEDIR%\maotao.bin avldr.xpe
Ren %PEDIR%\maotaoa.bin maotao.bin
>%PEDIR%\airL.gz <nul Set/p=%Pass2%
Copy /B %PEDIR%\airT.gz+%PEDIR%\airL.gz+%PEDIR%\airW.gz %PEDIR%\airmenu.ini>NUL 2>NUL&&Del %PEDIR%\air?.gz /Q>NUL 2>NUL>NUL 2>NUL
MyIns\MyIns.exe a -tGZip %PEDIR%\airmenu.gz %PEDIR%\airmenu.ini -w%PEDIR%>NUL 2>NUL&&Del %PEDIR%\airmenu.ini /Q>NUL 2>NUL&&Ren %PEDIR%\airmenu.gz airmenu.ini>NUL 2>NUL
Echo.
Echo 密码设置完成,请牢记您的密码,并按任意键继续 。。。
PAUSE>NUL 2>NUL
If Exist %RP%\LDRXPE %DelATTR% %RP%\LDRXPE
If Exist %RP%\WINNT.XPE %DelATTR% %RP%\WINNT.XPE
Echo.
Echo 正在复制文件,请稍候 。。。
MOVE %PEDIR%\MTLDR.PE %RP%\>NUL 2>NUL
Call :CopyAndSetFiles
Goto SUCCESS
:HDRPErr
CLS
Set RP=
For %%I In (Z Y X W V U T S R Q P O N M L K J I H G F E D C) Do If Exist %%I:\BootMGR Set RP=%%I:&&Set PEDIR=%%I:\MiniPE
If Not "%RP%"=="" (
TITLE %Prog%——检测到 Windows Vista 分区
Set OPT=Vista&&Set OPT0=存在 WinVista 分区&&Set OPT1=[I] 将 WimPE 安装到 Windows Vista 分区。
) Else (
TITLE %Prog%——没有检测到系统分区
Set OPT=NewHD&&Set OPT0=没有安装过操作系统&&Set OPT1=[I] 全新硬盘,将 WimPE 安装到活动分区。
)
Echo.
Echo %L1%
Echo %L2%
Echo %L3%
Echo %L4%
Echo %L5%
Echo %L6%
Echo ║ 好像您的机器中%OPT0%,您想怎么办?║
Echo %L6%
Echo ║ %OPT1% ║
Echo ║ [B] 返回首页,重新选择安装选项。 ║
Echo ║ [Q] 退出安装 ║
Echo %L6%
Echo ║ 注意: 为确保安全,此安装选项可能会卸载不干净!║
Echo %L7%
Echo %L8%
Echo %L9%
Echo.
Set Choice=
Set /P Choice= 请选择要进行的操作 (I/B/Q) ,然后按回车:
If "%Choice%"=="" Goto HDRPErr
If Not "%Choice%"=="" Set Choice=%Choice:~0,1%
If /I "%Choice%"=="I" If "%OPT%"=="Vista" Goto Vista
If /I "%Choice%"=="I" If "%OPT%"=="NewHD" Goto NewHD
If /I "%Choice%"=="B" Goto Start
If /I "%Choice%"=="Q" Exit
Goto HDRPErr
Exit
:Vista
Set PEDIR=%RP%\MiniPE
If Exist %RP%\MAOTAO Goto Err1
If Exist %PEDIR% Goto Err1
Echo.&&Echo.
Echo 正在复制文件,请稍候 。。。
If Exist %RP%\NTLDR %DelATTR% %RP%\NTLDR&&Ren %RP%\NTLDR NTLDR.BAK
Set NoLDR=Yes
If "%NoLDR%"=="Yes" MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% LDRXPE -r -y>NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% PE -r -y>NUL 2>NUL
If "%NoLDR%"=="Yes" Ren %RP%\LDRXPE NTLDR
Call :CopyAndSetFiles
Goto SUCCESS
:NewHD
CLS
TITLE %Prog%——在全新硬盘中安装
If "%NoNewErr%"=="Yes" Echo 错误:您设定的分区 %RP% 不存在、写保护、或未格式化,请按任意键重新设定。&&Echo.
Echo 请设置您需要安装 WinPE 到哪个分区(注意一定要是活动分区)
Echo.
Set /P RP=请输入您需要安装 WinPE 的分区符(不需要冒号,例如 C),然后按回车:
Echo.&&Echo.
If "%RP%"=="" Goto NewHD
If Not "%RP%"=="" Set RP=%RP:~0,1%:
For /F %%I In ('MYINS\CHECKUSB.EXE %RP%') DO SET Err2=%%I
If Not Exist %RP% Set NoNewErr=Yes&&Goto NewHD
Set TestFile=%RP%\MiniPETest_%RANDOM%.MT
Cd.>%TestFile%
If Not Exist %TestFile% Set NoNewErr=Yes&&Goto NewHD
Del %TestFile% /Q>NUL 2>NUL
Set PEDIR=%RP%\MiniPE
If Exist %RP%\MAOTAO Goto Err1
If Exist %PEDIR% Goto Err1
MyIns\NTBoot.exe %RP% >NUL
Echo.
Echo 正在复制文件,请稍候 。。。
If Exist %RP%\NTLDR %DelATTR% %RP%\NTLDR&&Ren %RP%\NTLDR NTLDR.BAK
Set NoLDR=Yes
If "%NoLDR%"=="Yes" MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% LDRXPE -r -y>NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% PE -r -y>NUL 2>NUL
If "%NoLDR%"=="Yes" Ren %RP%\LDRXPE NTLDR
Call :CopyAndSetFiles
Goto SUCCESS
:CopyAndSetFiles
If Not Exist %RP%\NTLDR MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% NTLDR -r -y >NUL 2>NUL
If "%U%"=="" For /F %%i In ("%RP%\NTLDR") Do If %%~zi LSS 250000 Set SysVer=2K >NUL 2>NUL
If "%NoLDR%"=="" MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP%\%LDRP% LDRXPE -r -y >NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% NTCOM -r -y>NUL 2>NUL >NUL 2>NUL
::If Not Exist %RP%\NTLDR MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% NTLDR -r -y >NUL 2>NUL
echo.
Copy ..\%PEFile% %PEDIR% /Y /Z
Copy ..\%OPFile% %PEDIR% /Y /Z
Copy ..\%PEIni% %PEDIR% /Y /Z
If "%U%"=="" If Exist %RP%\BOOT.INI %DelATTR% %RP%\BOOT.INI
If "%U%"=="" If Exist %RP%\BOOT.INI If Exist %RP%\BOOT.BAK %DelATTR% %RP%\BOOT.BAK
If "%U%"=="" If Exist %RP%\BOOT.INI Copy %RP%\BOOT.INI %RP%\BOOT.BAK>NUL 2>NUL
If "%U%"=="" If Exist %RP%\BOOT.INI TYPE %RP%\BOOT.BAK|FIND /I /V "C:\MiniPE">%RP%\BOOT.INI
If "%U%"=="" If Exist %RP%\BOOT.INI Echo C:\MiniPE\MAOTAO.BIN="WinPE">>%RP%\BOOT.INI
If /I "%SysVer%"=="2K" (
%DelATTR% %RP%\NTLDR&&%DelATTR% %RP%\bootfont.bin
Ren %RP%\NTLDR NTLDR.2K&&Ren %RP%\bootfont.bin bootfont.bin.2K
MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% NTLDR -r -y>NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% bootfont.bin -r -y>NUL 2>NUL
)
If Exist %RP%\%PEIni% %DelATTR% %RP%\%PEIni%
TYPE ..\%PEIni%|FIND /I /V "PESetup.EXE">%RP%\%PEIni%
%AddATTR% %RP%\MiniPE /S /D
::%AddATTR% %RP%\MiniPE\*.* /S /D
If Exist %RP%\BOOT.INI %AddATTR% %RP%\BOOT.INI
If Exist %RP%\%LDRP%LDRXPE %AddATTR% %RP%\%LDRP%LDRXPE
If Exist %RP%\MTLDR.PE %AddATTR% %RP%\MTLDR.PE
If Exist %RP%\nTLDR %AddATTR% %RP%\nTLDR
If Exist %RP%\mTLDR %AddATTR% %RP%\mTLDR
Goto :EOF
:SUCCESS
Title %Prog%——安装完成
CLS
For %%i 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 /I "%RP%"=="%%i:" Set RP=%%i:
Echo 已经成功将镜像 %PEFile% 安装到您的 %RP% 盘。
If "%U%"=="" (
Echo.
If Exist %RP%\Boot.INI Echo 系统分区中的 BOOT.INI 备份为 BOOT.BAK。
If Exist %PR%\Boot.ini bootcfg /timeout 0 >Nul 2>Nul
)
Echo.&&Echo.
Echo 如果您需要将 WinPE 卸载,请重新运行本安装程序。
Echo.
Echo 请按任意键退出 。。。
PAUSE>NUL 2>NUL
Exit |
|