复制代码
- @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%
- 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
- Del %TestFile% /Q>NUL 2>NUL
- 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
- Echo.
- Echo 您的 U 盘已经成功格式化并写入了 Grub 引导,请按任意键继续。。。
- PAUSE>NUL
- Goto GInstall
- :NoUD
- CLS
- Title %Prog%——U 盘安装
- Echo.
- Echo %L1%
- Echo %L2%
- Echo %L3%
- Echo %L4%
- Echo %L5%
- Echo %L6%
- Echo ║ 您的计算机似乎没有安装 U 盘,您想怎么办? ║
- Echo %L6%
- Echo ║ 返回首页,重新选择安装选项。 ║
- 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 ║ 返回首页,重新选择安装选项。 ║
- 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 迷你维护系统 ^(By: MAOTAO^)
- >>%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
- 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= 将 WimPE 安装到 Windows Vista 分区。
- ) Else (
- TITLE %Prog%——没有检测到系统分区
- Set OPT=NewHD&&Set OPT0=没有安装过操作系统&&Set OPT1= 全新硬盘,将 WimPE 安装到活动分区。
- )
- Echo.
- Echo %L1%
- Echo %L2%
- Echo %L3%
- Echo %L4%
- Echo %L5%
- Echo %L6%
- Echo ║ 好像您的机器中%OPT0%,您想怎么办?║
- Echo %L6%
- Echo ║ %OPT1% ║
- Echo ║ 返回首页,重新选择安装选项。 ║
- 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
- 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
- ::If Not Exist %RP%\NTLDR MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% NTLDR -r -y>NUL 2>NUL
- Copy ..\%PEFile% %PEDIR% /Y>NUL 2>NUL
- Copy ..\%OPFile% %PEDIR% /Y>NUL 2>NUL
- Copy ..\%PEIni% %PEDIR% /Y>NUL 2>NUL
- 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 By: 老毛桃">>%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%\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。
- )
- Echo.&&Echo.
- Echo 如果您需要将 WinPE 卸载,请重新运行本安装程序。
- Echo.
- Echo 请按任意键退出 。。。
- PAUSE>NUL 2>NUL
- Exit
本版规则
1、求代码、寻求代码解释、探讨代码得失的帖子均可发在本版块,其余话题禁止在本版讨论;
2、求助时,务必在顶楼一次性把问题交代清楚;若文字难以表述,请配图说明,或是上传附件;但是,一切操作应从节约论坛资源的角度出发,能文字说明清楚的就无需再发图片,小图能说明问题的尽量不截全图,在不影响效果的前提下尽量压缩图片及附件;
3、所发代码若不止一行,请务必用code标记把代码部分首尾括起来,以便他人复制;
复制代码
- If Not Exist .\PESETUP.INI Goto Err0
- :Err0
- Echo 错误:安装配置文件丢失!&&Echo.
- Echo 请确认安装配置文件 %SetupINIFile% 存在或到本程序所在目录执行安装。&&Echo.
- Echo 请按任意键退出安装程序。。。
复制代码
- @echo off
- if exist C:\mtldr (
- goto jc01
- ) else (
- set n1=C:\mtldr
- goto err
- )
- :err
- color 4f
- echo 错误 好像你的系统没有正确安装PE系统、
- echo.
- echo 缺失文件 %n1% %n2%请安装后再运行本程序 按任一键退出
- pause >nul
- exit
- :jc01
- if exist C:\MiniPE\OP.WIM (
- goto jc02
- ) else (
- set n2=C:\MiniPE\OP.WIM
- goto err
- )
- :jc02
- color 6f
- goto bigen
- :bigen
- echo ok 可以安装 没有发现少了相应的文件
- pause
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |