无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 2238|回复: 1
打印 上一主题 下一主题

请高手帮忙看下这个批处理。有什么问题要修改。

[复制链接]
跳转到指定楼层
1#
发表于 2009-1-4 01:35:00 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
  想学习批处理。找来老毛的一个,进行了修改。目前在XP。VISTA系统下测试均能正常安装PE、但是到2000下测试(是虚拟机中)。就是不能写入OP.WIM.
后加入了一句。《If Not Exist %RP%MINIPE/OP.WIM copy MYINS\OP.WIM %PEDIR% >NUL 2>NUL》。虽然能写入了。但安装时会提示“找不到指定的文件”
不知道如何解决。拿来老毛的原程序安装,也是不能写入OP.WIIM.真不知是为什么了。请高手指点。
  我现在进行的修改,是将老毛和小马的安装程序进行整合的。可以判断是什么系统。VISTA/XP下测试都能正常。只是那个Aero安装。在安装到VISTA系统下时,虽然安装
成功。但不能成功启动。看老毛原版说“Aero 安装项只适合系统分区在(HD0,0)分区”,不知是不是这个原因。如何能解决呢?
  希望得到众位高手的指点。先谢谢了。

@Echo Off
COLOR 9f
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 PEFile=MiniPE\WinPE.IS_
Set PEIni=MiniPE\WinPE.INI
Set LogFile=PEInstall.log
Set SetupINIFile=PESetup.INI
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
:TheOS  ::判断系统版本并设置TheOS
if /i not "%os%."=="Windows_NT." goto SystemErro
ver|find /i " 6.0">nul &&set Winver=vista&&  set TheOS=Vista
ver|find /i " 5.0">nul &&set Winver=winnt&&  set TheOS=2000
ver|find /i " 5.1">nul &&set Winver=winnt&&  set TheOS=XP
ver|find /i " 5.2">nul &&set Winver=winnt&&  set TheOS=2003
if /i "%TheOS%"=="Vista" Goto Start
if /i "%TheOS%"=="2000" Goto Start
if /i "%TheOS%"=="2003" Goto Start
if /i "%TheOS%"=="xp" Goto Start
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
:Start
Title %Prog%——安装
If "%Diks%"=="Empty" Call .\WINDOWS引导修复\FIXBOOT.CMD
CLS
Echo.
Echo %L1%
Echo %L2%
Echo %L3%
Echo %L4%
Echo %L5%
Echo %L6%
Echo    ║  请选择安装方式:               ║
Echo %L6%
Echo    ║ [1] 普通安装/启动 (硬盘安装)          ║
Echo    ║ [2] Grub安装/启动 (硬盘安装 MAXDOS + GHOST)   ║
ECHO       ║ [3] Aero安装/启动 (硬盘安装,支持密码)     ║
Echo    ║ [4] Grub安装/启动 (U盘/移动盘 MAXDOS + GHOST) ║
Echo    ║ [Q] 退出安装                  ║
Echo %L6%
Echo %L7%
Echo    ║ 注意: Aero 安装项只适合系统分区在(HD0,0)分区 ║
Echo %L7%
Echo %L8%
Echo %L9%
Echo       您现在使用的是 Windows %TheOS% 操作系统 !
if "%TheOS%"=="XP" Echo       ( 或 Windows XP 核心的 WinPE )
if "%TheOS%"=="2003" Echo       ( 或 Windows 2003 核心的 WinPE )
if "%TheOS%"=="Vista" Echo       ( 请确保您拥有管理员权限以及关闭了UAC,否则安装可能失败 )
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:
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:
If "%RP%"=="" Goto HDRPErr
Set PEDIR=%RP%\MiniPE&&Set TargetP=硬盘&&Set TxtSp=
Set DSDIR=%RP%\MAXDOS&&Set TargetP=硬盘&&Set TxtSp=
If Exist %PEDIR% Goto Err1
If Exist %DSDIR% Goto Err1
FIND /I "%RP%\MAOTAO" %RP%\BOOT.INI>NUL 2>NUL
If "%Errorlevel%"=="0" Goto Err1
FIND /I "%RP%\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
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
: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
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
:SystemErro
cls
Echo.
Echo.
Echo  注意:未经测试,本软件可能不适用于非 Windows PE/2000/XP/2003/Vista 操作系统。
Echo  按回车键退出安装程序
Pause >nul
Exit
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
: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=
Set U=U&&Set DSDIR=%RP%\MAXDOS&&Set TargetP= U 盘&&Set TxtSp=
If Exist %RP%\MAOTAO Goto Err1
If Exist %PEDIR% Goto Err1
If Exist %DSDIR% 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
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
: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
Set PEDIR=%%I:\MiniPE
Set DSDIR=%%I:\MAXDOS
Set HDD0=没有安装过操作系统&&Set HDD1=[I] 全新硬盘,请先修复WINDOWS引导再执行安装
Echo.
Echo %L1%
Echo %L2%
Echo %L3%
Echo %L4%
Echo %L5%
Echo %L6%
Echo    ║ 好像您的机器中%HDD0%,您想怎么办?║
Echo %L6%
Echo    ║ %HDD1%   ║
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" Set Diks=Empty&Goto Start
If /I "%Choice%"=="B" Goto Start
If /I "%Choice%"=="Q" Exit
Goto HDRPErr
Exit
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
: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
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
: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 /i "%TheOS%"=="Vista" (
        If Exist %RP%\ntldr %DelATTR% %RP%\ntldr&&Del %RP%\ntldr /Q>NUL 2>NUL
)
If /I "%TheOS%"=="2000" (
If Exist %RP%\bootfont.bin %DelATTR% %RP%\bootfont.bin&&Del %RP%\bootfont.bin>NUL 2>NUL
If Exist %RP%\ntldr %DelATTR% %RP%\ntldr&&Del %RP%\ntldr>NUL 2>NUL
        If Exist %RP%\bootfont.bin.2K %DelATTR% %RP%\bootfont.bin.2K&&Ren %RP%\bootfont.bin.2K bootfont.bin
If Exist %RP%\NTLDR.2K %DelATTR% %RP%\NTLDR.2K&&Ren %RP%\NTLDR.2K NTLDR
If Exist %RP%\bootfont.bin %AddATTR% %RP%\bootfont.bin
If Exist %RP%\NTLDR %AddATTR% %RP%\NTLDR
)
If Exist %OPD%\外置程序 RD %OPD%\外置程序 /S /Q>NUL 2>NUL
If Exist %OPD%\MINIPE RD %OPD%\MINIPE /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
If Exist %RP%\MAXDOS RD %RP%\MAXDOS /S /Q>NUL 2>NUL
%DelATTR% %RP%\BOOT.INI>NUL 2>NUL
FIND /I "%RP%\MINIPE" %RP%\BOOT.INI>NUL 2>NUL
If "%Errorlevel%"=="0" %DelATTR% %RP%\BOOT.INI&&Del %RP%\BOOT.INI
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
CLS
Title %Prog%——普通安装
echo.
Echo.&&Echo 现在正安装 WINPE 维护系统到你的 %RP% 盘中. 请稍后......
Set PEDIR=%RP%\MiniPE&&Set TargetP=硬盘&&Set TxtSp=
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
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
CLS
If "%U%"=="" Title %Prog%——Grub安装
echo.
Echo.&&Echo 现在正安装 WINPE 维护系统到你的 %RP% 盘中. 请稍后......
Set LDRP=MiniPE\
If Not Exist %PEDIR% MD %PEDIR%>NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%RP% MTLDR -r -y>NUL 2>NUL
>>%RP%\MTLDR Echo fontfile /minipe/muifont.gz
>>%RP%\MTLDR Echo splashimage /minipe/bj2008.xpm.gz
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 运行    WinPE 迷你维护系统 ^(By: 小阎^)
>>%RP%\MTLDR Echo chainloader /minipe/ldrxpe
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 运行    GHOST合集
>>%RP%\MTLDR Echo map --mem /minipe/ghost.img (fd0)
>>%RP%\MTLDR Echo map --hook
>>%RP%\MTLDR Echo chainloader (fd0)+1
>>%RP%\MTLDR Echo rootnoverify (fd0)
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 运行    MaxDOS 6.0
>>%RP%\MTLDR Echo map --mem /MaxDOS/Maxgzs.gz (fd0)
>>%RP%\MTLDR Echo map --hook
>>%RP%\MTLDR Echo chainloader (fd0)+1
>>%RP%\MTLDR Echo rootnoverify (fd0)
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 运行    纯DOS工具箱
>>%RP%\MTLDR Echo map --mem /minipe/dos98.img (fd0)
>>%RP%\MTLDR Echo map --hook
>>%RP%\MTLDR Echo chainloader (fd0)+1
>>%RP%\MTLDR Echo rootnoverify (fd0)
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 运行    Grub 命令行
>>%RP%\MTLDR Echo commandline
>>%RP%\MTLDR Echo.
>>%RP%\MTLDR Echo title 从第一硬盘第一分区启动
>>%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
If Exist %RP%\LDRXPE %DelATTR% %RP%\LDRXPE
If Exist %RP%\WINNT.XPE %DelATTR% %RP%\WINNT.XPE
If Exist %RP%\MTLDR %DelATTR% %RP%\MTLDR
For /f %%i In (MAXDOS\MAXDOS.SYS) Do MAXDOS\MAXDOS.exe e MAXDOS\MAXDOS.dll -o%DSDIR% %%i -r -y>NUL 2>NUL
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
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% DOS98.IMG -r -y>NUL 2>NUL
MyIns\MyIns.exe e MyIns\MyIns.dll -o%PEDIR% GHOST.IMG -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
If "%U%"=="" Ren %DSDIR%\MAXS.ABC MAXS.SYS
Call :CopyAndSetFiles
Goto SUCCESS
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
:AInstall
CLS
Title %Prog%——Aero安装
call :ifpass
Echo.&&Echo 现在正安装 WINPE 维护系统到你的 %RP% 盘中. 请稍后......
Set PEDIR=%RP%\MiniPE&&Set TargetP=硬盘&&Set TxtSp=
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
If Exist %RP%\LDRXPE %DelATTR% %RP%\LDRXPE
If Exist %RP%\WINNT.XPE %DelATTR% %RP%\WINNT.XPE
MOVE %PEDIR%\MTLDR.PE %RP%\>NUL 2>NUL
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=2000
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 %RP%\MINIPE\MAOTAO.BIN="WinPE By 智林电脑维修站-小阎制作">>%RP%\BOOT.INI
If "%U%"=="" If Exist %RP%\BOOTMGR (
        CALL :BOOT
        If Exist %RP%\NTLDR %AddATTR% %RP%\NTLDR /S /D
)
If /I "%SysVer%"=="2000" (
        If Exist %RP%\NTLDR %DelATTR% %RP%\NTLDR /S /D
        If Exist %RP%\bootfont.bin %DelATTR% %RP%\bootfont.bin /S /D
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%\NTLDR %AddATTR% %RP%\NTLDR /S /D
        If Exist %RP%\NTLDR.2K %AddATTR% %RP%NTLDR.2K /S /D
        If Exist %RP%\bootfont.bin %AddATTR% %RP%\bootfont.bin /S /D
        If Exist %RP%\bootfont.bin.2K %AddATTR% %RP%\bootfont.bin.2K /S /D
)
If Not Exist %RP%MINIPE/OP.WIM copy MYINS\OP.WIM %PEDIR% >NUL 2>NUL
If Exist %RP%\MiniPE %AddATTR% %RP%\MiniPE /S /D
If Exist %RP%\MiniPE\*.* %AddATTR% %RP%\MiniPE\*.* /S /D
If Exist %RP%\MAXDOS %AddATTR% %RP%\MAXDOS /S /D
If Exist %RP%\MAXDOS\*.* %AddATTR% %RP%\MAXDOS\*.* /S /D
If Exist %RP%\BOOT.INI %AddATTR% %RP%\BOOT.INI
If Exist %RP%\BOOT.BAK %AddATTR% %RP%\BOOT.BAK /S /D
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
If "%U%"=="" Call :添加日志
Goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:BOOT
set timeout=5
Set PEDIR=%RP%\MINIPE
set gname=WinPE By XiaoYAN
set gname2=MINIPE\MAOTAO.BIN
ECHO [boot loader]>>%RP%\BOOT.INI
ECHO "timeout=5">>%RP%\BOOT.INI
ECHO [operating systems]>>%RP%\BOOT.INI
ECHO %RP%\%gname2%="%gname%">>%RP%\BOOT.INI
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。多系统同上,                               (如果是vista系统,添加的BOOT.INI,卸载时会删除)
)
Echo.&&Echo.
Echo 如果您需要将 WinPE 卸载,请重新运行本安装程序。
Echo.
Echo 请按任意键退出......
PAUSE>NUL 2>NUL
Exit
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:添加日志
>%RP%\%LogFile% Cd.
>>%RP%\%LogFile% Echo ;此文件为 WinPE 的安装LogFile,请不要随意删除
>>%RP%\%LogFile% Echo ;否则可能会造成 WinPE 的卸载不够彻底!!!
>>%RP%\%LogFile% Echo.
>>%RP%\%LogFile% Echo WinPE镜像文件=%PEFile%
>>%RP%\%LogFile% Echo WinPE外挂位置=%RP%\MiniPE
>>%RP%\%LogFile% Echo MAXDOS6.0文件=%RP%\MAXDOS
>>%RP%\%LogFile% Echo WinPE安装日期=%Date% %Time%
%AddATTR% %RP%\%LogFile%
Goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:ifpass
cls
echo.
echo.
echo ---------------------------------------------------------------------------
echo.
Echo     设置WINPE启动密码可以是您的系统更加的安全,建议您设置密码。
echo.     
echo ---------------------------------------------------------------------------
echo.
set /p Cho=如果要设定PE登陆密码请输入Y,否则按其他任意键。
if /i "%Cho%"=="Y" CALL :password
Goto :EOF
:password
Echo.
Echo 注意:密码中不许有空格、"\"、引号等特殊字符
Echo.
Set /P Pass1=请输入密码:
If "%Pass1%"=="" Goto password
Echo.
Echo 请再一次输入您的密码
Echo.
Set /P Pass2=请再次输入密码:
If "%Pass2%"=="" Goto password
If Not "%Pass2%"=="%Pass1%" Echo.&&Echo 您两次输入的密码不一致,请重新输入&&Echo 请按任意键重新开始设置密码&&PAUSE>NUL 2>NUL&&Goto password
Echo.
If NOT "%Pass2%"=="" (
echo ╭──────────────────────────────╮
echo     您设置的Winpe启动密码为  %Pass1%  ,按任意键继续......
echo ╰──────────────────────────────╯
)
pause >nul
Goto :EOF
2#
 楼主| 发表于 2009-1-4 20:49:57 | 只看该作者
没人解决。我自己搞定了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-11-29 04:48

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表