复制代码
- @Echo Off
- color 1E
- Set Prog= Windows PE 安装系统
- Set L1= ╭══════════════════╮
- Set L2= ║ ║
- Set L3= ╭══┤ %Prog% ├══╮
- Set L4= ║ ║ ║ ║
- Set L5= ║ ╰══════════════════╯ ║
- Set L6= ║ ║
- Set L7= ╟════════════════════════╢
- Set L8= ╰────────────────────────╯
- Title %Prog%
- Set RP=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%==RP Goto NoSys
- If Exist %RP%\PELDR Goto :EXISTPE
- If Exist %RP%\AVLDR Goto :EXISTPE
- FIND /I "C:\AVLDR" %RP%\BOOT.INI >NUL
- If %Errorlevel%==0 Goto :EXISTPE
- Goto Start
- :EXISTPE
- CLS
- Title %Prog%
- Echo.
- Echo %L1%
- Echo %L2%
- Echo %L3%
- Echo %L4%
- Echo %L5%
- Echo %L6%
- Echo │ │
- Echo │ 检测到您机器中已经安装了 WinPE,您要卸载吗? │
- Echo │ │
- Echo │ [ 1 ] 卸载原有的 WinPE,并重新安装 WinPE │
- Echo │ │
- Echo │ [ 2 ] 卸载原有的 WinPE,并删除原有 WinPE │
- Echo │ │
- Echo │ [ Q ] 退出安装系统 │
- Echo │ │
- Echo %L7%
- Echo %L8%
- Echo.
- Set Choice=
- Set /P Choice= 请选择要进行的操作 (1/2/Q) ,然后按回车:
- If %Choice%Choice==Choice Goto :EXISTPE
- 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%'=='Q' EXIT
- Goto :EXISTPE
- :UnInstall
- If Exist %RP%\AVLDR ATTRIB -S -H -R %RP%\AVLDR && Del /Q /F %RP%\AVLDR >NUL
- If Exist %RP%\PELDR ATTRIB -S -H -R %RP%\PELDR && Del /Q /F %RP%\PELDR >NUL
- If Exist %RP%\WINNT.SIF ATTRIB -S -H -R %RP%\WINNT.SIF && Del /Q /F %RP%\WINNT.SIF >NUL
- If Exist %RP%\WINPE.ISO ATTRIB -S -H -R %RP%\WINPE.ISO && Del /Q /F %RP%\WINPE.ISO >NUL
- If Exist %RP%\WINPE.IMG ATTRIB -S -H -R %RP%\WINPE.IMG && Del /Q /F %RP%\WINPE.IMG >NUL
- Attrib %RP%\BOOT.INI -S -H -R
- If Exist %RP%\BOOT.BAK (
- Attrib %RP%\BOOT.BAK -S -H -R
- TYPE %RP%\BOOT.BAK|FIND /I /V "C:\AVLDR">%RP%\BOOT.INI
- ) Else (
- Copy %RP%\BOOT.INI %RP%\BOOT.BAK /Y>NUL
- TYPE %RP%\BOOT.BAK|FIND /I /V "C:\AVLDR">%RP%\BOOT.INI
- )
- Copy %RP%\BOOT.INI %RP%\BOOT.BAK /Y>NUL
- If Exist %RP%\BOOT.BAK ATTRIB -S -H -R %RP%\BOOT.BAK&&Del %RP%\BOOT.BAK>NUL
- Attrib %RP%\BOOT.INI +S +H +R
- FOR %%I IN (Z: Y: 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\GHOST~1 Set ddd=%%I
- FOR %%I IN (Z: Y: 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\GHOST Set eee=%%I
- If Not "%eee%"=="" goto :ghostq
- If Not "%ddd%"=="" goto :ghostq
- :UninstallOK
- Title %Prog%
- If %Choi%Choi==1Choi (Echo.&&Echo 卸载完成,请按任意键准备安装 …… &&PAUSE>NUL&&Goto Start)
- Echo.&&Echo 卸载完成,请按任意键退出 ……
- PAUSE>NUL
- Exit
- :ghostq
- Set ddd=%ddd:~0,1%:
- set Ugh=
- Echo.
- set /P Ugh= [删除GHOST备份目录和文件 按 Y] [不删除 请直接回车]
- if /I "%Ugh%" == "Y" goto :ghostd
- goto UninstallOK
- :ghostd
- If Exist %ddd%\GHOST~1 rd %ddd%\GHOST~1 /s/q
- If Exist %eee%\GHOST rd %eee%\GHOST /s/q
- goto UninstallOK
- :Start
- CLS
- Title %Prog%
- Echo.
- Echo %L1%
- Echo %L2%
- Echo %L3%
- Echo %L4%
- Echo %L5%
- Echo %L6%
- Echo │ │
- Echo │ [ 1 ] 安装 WinPE 到 C 盘并添加启动菜单 │
- Echo │ │
- Echo │ [ Q ] 退出安装系统 │
- Echo │ │
- Echo %L7%
- Echo %L8%
- Echo.
- Set Choice=
- Set /P Choice= 请选择要进行的操作 (1/Q) ,然后按回车:
- If %Choice%Choice==Choice Goto Start
- If Not '%Choice%'=='' SET Choice=%Choice:~0,1%
- If /I '%Choice%'=='1' GOTO Install
- If /I '%Choice%'=='q' EXIT
- Goto Start
- :Install
- Title %Prog%
- If Exist %RP%\WINNT.SIF Del /Q /F %RP%\WINNT.SIF >NUL
- Echo.
- Echo 正在复制文件,请稍候 ……
- If Exist AVLDR Copy AVLDR %RP%\ /Y >NUL
- If Exist PELDR Copy PELDR %RP%\ /Y >NUL
- If Exist WINNT.SIF Copy WINNT.SIF %RP%\ /Y >NUL
- If Exist winpe.is_ Expand winpe.is_ %RP%\WINPE.ISO >NUL
- If Exist WINPE.IM_ Expand WINPE.IM_ %RP%\WINPE.IMG >NUL
- ATTRIB -S -H -R %RP%\BOOT.INI
- ECHO %RP%\AVLDR= "Microsoft Windows PE " >>%RP%\boot.ini
- BOOTCFG /Timeout 3
- If Exist %RP%\BOOT.INI ATTRIB +S +H +R %RP%\BOOT.INI >NUL
- If Exist %RP%\AVLDR ATTRIB +S +H +R %RP%\AVLDR
- If Exist %RP%\PELDR ATTRIB +S +H +R %RP%\PELDR
- If Exist %RP%\WINNT.SIF ATTRIB +S +H +R %RP%\WINNT.SIF
- If Exist %RP%\WINPE.ISO ATTRIB +S +H +R %RP%\WINPE.ISO
- If Exist %RP%\WINPE.IMG ATTRIB +S +H +R %RP%\WINPE.IMG
- Goto :SUCCESS
- :NoSys
- Echo.
- Echo.
- Echo 您机器中没有安装操作系统
- Echo.
- Echo 请确认后再执行本安装程序
- Echo.
- Echo 请按任意键退出 ……
- PAUSE >NUL
- Exit
- :SUCCESS
- Title %Prog%
- Echo.
- Echo 安装完成!请按任意键退出 ……
- PAUSE >NUL
- Exit
[ 本帖最后由 foxtrader 于 2008-9-6 10:35 编辑 ]
欢迎光临 批处理之家 (http://bathome.net./) | Powered by Discuz! 7.2 |