|
既然用NSIS打包,不如就直接用NSIS制作一个,最近我也想用NSIS实现一个这样的程序,只做参考。
另:====.....为我省略的一部分,大家懂大体意思就可以了,不要抄袭原作者。
?CMD4F11.CMD。别生气哦:
@Echo Off
color 1a
title WinPE 通用安装工具 --→ 制作:逍遥浪子
set path=%cd%;%cd%\grubutil;%SystemRoot%\system32
goto Setup_chkeck
:Setup_chkeck
If Exist %SystemRoot%\system32\find.exe Del /q find.exe>nul 2>nul
If Exist %SystemRoot%\system32\xcopy.exe Del /q xcopy.exe>nul 2>nul
goto Setup_Mode
:Setup_Mode
cls
Echo ╭───────────╮
Echo ╭──────┤ WinPE 通用安装工具 ├──────╮
Echo │ ╰───────────╯ │
Echo │ │
Echo │ [1] 安装到 Win2k/XP/2003 系统(NTLDR + Grldr) │
Echo │ │
Echo │ [2] 安装到 Win2k/XP/2003 系统(NTLDR + Avlgo) │
Echo │ │
Echo │ [3] 安装到 Windows Vista 系统(bootmgr+Grldr) │
Echo │ │
Echo │ [4] 安装到 固定硬盘 MBR(Grldr启动,支持热键) │
Echo │ │
Echo │ [5] 安装到 U盘/USB移动硬盘(MSDOS + Grub4DOS) │
Echo │ │
Echo │ [6] 安装到 U盘/USB移动硬盘MBR(直接Grldr引导) │
Echo │ │
Echo │ │
Echo │ 注:选择安装模式(默认是第1项,直接回车) │
Echo ╰─────────────────────────╯
Echo.
Echo 卸载 退出 [X]
Echo ───────────────────────────
Echo.
Set m=
Set /p m= 请选择想要的操作(数字或字母按键/回车):
If "%m%"=="1" Set m=Xyldr&Goto Find_NT
If "%m%"=="2" Set m=AVLDR&Goto Find_NT
If "%m%"=="3" Goto find_Vista
If "%m%"=="4" Goto HD_Set
If "%m%"=="5" Goto ChkUSB
If "%m%"=="6" Goto ChkUSB
If %m%#==# Set m=Xyldr&Goto Find_NT
If /i "%m%"=="U" goto UnInstall
If /i "%m%"=="X" Goto quit
Goto Setup_Mode
:Find_NT
for /f "tokens=1,2,* delims=:" %%i in ('CheckUSB.exe^|find "当前可移动磁盘分区:"') DO set U1=%%i&set U2=%%j&set U3=%%
=====================================================
echo.
echo.
echo 你的电脑好像没有安装 Win2K/XP/2003 系统,安装程序不能继续!按任意键返回主菜单...
pause>nul
goto Setup_Mode
:Find_Vista
set MyOS=
For %%V In (c d e f g h i j k l m n o p q r s t u v w) Do If Exist %%V:\boot\bcd Set p=%%V
if not exist %p%: cls&echo.&echo 你的电脑好像没有安装 Vista 系统,安装程序不能继续,按任意键返回!&pause>nul&goto Setup_Mode
if exist %p%:\BootMgr set MyOS=Vista
if /i "%MyOS%"="Vista" goto PESysDir
==================================================
:ChkUSB
:: 查找U盘/USB硬盘
echo.
if not "%uFormat%"=="YES" set uFormat=NO
for /f "tokens=1,2,* delims=:" %%i in ('CheckUSB.exe^|find "当前可移动磁盘分区:"') DO set U1=%%i&set U2=%%j&set U3=%%k
if "%U1%"=="当前可移动磁盘分区:" cls&echo.&echo 你的电脑似乎没有USB设备,按任意键重新开始。&pause>nul&goto Setup_Mode
if "%uFormat%"=="NO" goto Format_USB
if exist %U1:~-1,1%: Set UD1=%U1:~-1,1%
if exist %U2:~-1,1%: Set UD2=%U2:~-1,1%
if not "%U3%"=="" Set UD3=%U3:~-1,1%
if exist %UD3%: goto UD3Set
if exist %UD2%: goto UD2Set
if exist %UD1%: set UD=%UD1%
Goto PESysDir
:UD2Set
cls
echo.
echo.
echo.
Echo 可用的USB设备: %UD1%: %UD2%:
Echo ───────────────────────
Echo 选择待安装U盘/USB硬盘(默认是%UD1%,直接回车)
Echo.
echo.
echo.
Set UD=
Set /p UD= 请选择刚才操作的USB设备盘符,无须:号》
if "%UD%"=="" set UD=%UD1%
if /i "%UD%"==%UD1% set UD=%UD1%
if /i "%UD%"==%UD2% set UD=%UD2%
if /i not %UD%==%UD1% if /i not %UD%==%UD2% goto UD2Set
if exist %UD%: Goto PESysDir
goto UD2Set
:UD3Set
cls
echo.
echo.
echo.
Echo 可用的USB设备: %UD1%: %UD2%: %UD3%:
Echo ───────────────────────
Echo 选择待安装U盘/USB硬盘(默认是%UD1%,直接回车)
Echo.
Echo.
Echo.
Set UD=
Set /p UD= 请选择刚才操作的USB设备盘符,无须:号》
if "%UD%"=="" set UD=%UD1%
if /i "%UD%"==%UD1% set UD=%UD1%
if /i "%UD%"==%UD2% set UD=%UD2%
if /i "%UD%"==%UD3% set UD=%UD3%
if /i not %UD%==%UD1% if /i not %UD%==%UD2% set NOSet=Yes
if "%NOSet%"=="Yes" if /i not %UD%==%UD3% goto UD3Set
if exist %UD%: Goto PESysDir
goto UD3Set
:HD_Set
cls
echo.
echo.
echo 提示:可以打开系统自带的“磁盘管理”查看对照
echo.
echo.
echo.
echo.
echo 选择待安装硬盘(默认是0,直接回车)
echo ─────────────────────────────
echo 注:支持3个硬盘,0表示第一硬盘,1表示第二硬盘,以此类推
echo.
echo.
echo.
=====================================================
echo.
echo 提示:若刚才所选硬盘安装有系统,请设置热键
echo.
echo.
echo.
echo.
echo 选择启动热键(默认是2,直接回车)
echo ───────────────────────────
echo 注:0表示F9,1表示F11,2表示F12,3表示不使用
echo.
echo.
echo.
Set k=
Set /p k= 请输入启动热键左边代号》
If %k%#==# if not exist %p%: Set k=F12&goto Setup_Manual
If %k%#==# Set k=F12&Goto PESysDir
If %k% LEQ 3 (
If %k%==0 Set k=F9
If %k%==1 Set k=F11
If %k%==2 Set k=F12
If %k%==3 Set k=
if not exist %p%: goto Setup_Manual
Goto PESysDir
) Else (
cls
Echo.
Echo 输入错误,超出约定的安装范围(F9、F11、F12),按任意键继续...
pause>nul
)
Goto Hot_Key
:Setup_Manual
cls
echo.
echo.
echo 当前系统盘是:%systemDrive%
echo.
echo.
echo.
echo.
echo 输入安装位置(默认是D盘,直接回车)
echo ───────────────────────────
echo 提示:非硬盘MBR的引导方式,将默认安装到C盘
echo.
echo.
echo.
Set p=
Set /p p= 请输入待安装分区的盘符》
if %p%#==# If "%m%"=="4" set p=d
If %p%#==# If not "%m%"=="4" Set p=c
Set p=%p::=%
If Exist %p%: (
Goto PESysDir
) Else (
cls
Echo.
Echo 输入错误,%p% 盘不存在或没有格式化,按任意键继续...
pause>nul
)
Goto Setup_Manual
:PESysDir
cls
echo.
echo.
echo.
echo 选择PE系统目录名(默认是第3项,直接回车)
echo ────────────────────────
echo.
echo [1] I386
echo [2] WXPE
echo → [3] LXPE
echo [4] RXPE
echo [5] CMPE
echo [6] MSPE
echo [7] WINS
echo.
echo ────────────────────────
Set sysdir=
Set /p sysdir= 请选择操作(输入相关按数字键,回车):
If "%sysdir%"=="1" Set sysdir=I386&Goto pe_sPath
If "%sysdir%"=="2" Set sysdir=WXPE&Goto pe_sPath
If "%sysdir%"=="3" Set sysdir=LXPE&Goto pe_sPath
If "%sysdir%"=="4" Set sysdir=RXPE&Goto pe_sPath
If "%sysdir%"=="5" Set sysdir=CMPE&Goto pe_sPath
If "%sysdir%"=="6" Set sysdir=MSPE&Goto pe_sPath
If "%sysdir%"=="7" Set sysdir=WINS&Goto pe_sPath
If "%sysdir%"=="" Set sysdir=LXPE&Goto pe_sPath
cls&Echo.&Echo 输入错误,%sysdir%项目不存在,按任意键继续...&pause>nul
Goto PESysDir
:pe_sPath
cls
echo.
echo.
Echo.
Echo 输入源PE镜像的完整路径(包括文件名)
Echo ──────────────────────────────
Echo 搜索光盘(光盘必须是单独的PE镜像)→ 直接回车
Echo.
Echo.
Echo.
Set pefile=
Set /p pefile= 请输入路径或把文件拉到我这里来》
If Not {%pefile%}=={} (
set pefile=%pefile:"=%
If Not Exist %pefile% Goto pe_sPath
If "%m%"=="3" Goto Vista_Mode
If "%m%"=="4" Goto MBR_Mode
If "%m%"=="5" Goto USB_Mode
If "%m%"=="6" Goto USB_Mode
Goto NT_Mode
) Else (
Goto FindCD
)
Goto pe_sPath
:FindCD
setlocal enabledelayedexpansion
For /f "delims=\" %%i In ('fsutil fsinfo drives^|find /v ""') do (
Set CDVD=%%i
fsutil fsinfo drivetype !CDVD:~-2!|find /i "CD-ROM">nul && Set cdrom=!CDVD:~-2!
)
For %%f in (dir %CDROM%\*.img %CDROM%\*.im_ %CDROM%\*.iso %CDROM%\*.is_) Do Set pefile=%%f
=====================================================
If "%m%"=="6" Goto USB_Mode
Goto NT_Mode
:Format_USB
If "%m%"=="5" (
cls
Echo.
Echo 准备制作启动型U盘。操作完成请关闭软件,将继续执行未完成的安装任务。
echo.
Echo 注意:请选择"USB设备"下面的设备盘符,并选择FAT或FAT32,勾选"创建一个DOS启动盘"
start /wait HPUSBFW.exe
) Else (
cls
Echo.
Echo 准备安装 GRUB 到U盘MBR,操作完成请关闭软件,将继续执行未完成的安装任务。
echo.
Echo 注意:请选择"磁盘"里面的USB设备,并选中"启动时不搜索软盘",启动文件:Xyldr
start /wait Grub_Setup.exe
)
set uFormat=YES
Goto ChkUSB
:USB_Mode
cls
Echo.
Echo 开始安装PE到U盘(USB移动硬盘),请稍候...
For /f "delims=" %%i In ("%pefile%") Do Set pepath=%%~dpi&Set file=%%~nxi&Set FileExt=%%~xi
For %%n In (NTDETECT.COM Xyldr Config.sys XyG4D.exe PELDR WinPE.SIF WinPE%FileExt%) Do attrib -r -h -s %UD%:\%%n>nul 2>nul
If "%m%"=="5" (
Copy XyG4D.exe %UD%:\ /y>nul
if exist %UD%:\Config.sys Ren %UD%:\Config.sys Config.sys.old
Copy Config.sys %UD%:\ /y>nul
) Else (
Copy Xyldr %UD%:\ /y>nul
)
Copy PELDR %UD%:\ /y>nul
Copy WinPE.SIF %UD%:\ /y>nul
Copy NTDETECT.COM %UD%:\ /y>nul
sfk replace "/LXPE/%sysdir%/" -file %UD%:\PELDR -yes>nul 2>nul
inifile.exe %UD%:\WinPE.sif [SetupData] /remove
inifile.exe %UD%:\WinPE.sif [SetupData]
inifile.exe %UD%:\WinPE.sif [SetupData] BootDevice="ramdisk(0)"
inifile.exe %UD%:\WinPE.sif [SetupData] BootPath="\%Sysdir%\System32\"
If /i "%FileExt%"==".img" Echo OsLoadOptions="/minint /fastdetect /rdpath=WinPE.IMG">>%UD%:\WinPE.sif
If /i "%FileExt%"==".im_" Echo OsLoadOptions="/minint /fastdetect /rdpath=WinPE.IM_">>%UD%:\WinPE.sif
If /i "%FileExt%"==".iso" Echo OsLoadOptions="/minint /fastdetect /rdexportascd /rdpath=WinPE.ISO">>%UD%:\WinPE.sif
If /i "%FileExt%"==".is_" Echo OsLoadOptions="/minint /fastdetect /rdexportascd /rdpath=WinPE.IS_">>%UD%:\WinPE.sif
If /i "%pefile%"=="%UD%:\WinPE%FileExt%" (
For %%h In (Xyldr XyG4D.exe PELDR Config.sys NTDETECT.COM WinPE.SIF WinPE%FileExt%) Do attrib +r +h +s %UD%:\%%h>nul 2>nul
cls&Echo.&Echo WinPE 成功安装到U盘(USB移动硬盘)%UD%: 盘!按任意键重启计算机...&pause>nul
) Else (
If Exist %UD%:\WinPE%FileExt% Ren %UD%:\WinPE%FileExt% WinPE%FileExt%.old
XCopy "%pefile%" %UD%:\ /h /q /r /c /y>nul&&attrib -r -s -h "%UD%:\%file%">nul
If /i Not "%file%"=="WinPE%FileExt%" Ren "%UD%:\%file%" WinPE%FileExt%
If Exist "%pepath%外置程序" XCopy "%pepath%外置程序" %UD%:\外置程序\ /e /h /q /r /c /y>nul
If Exist "%pepath%*.WIM" echo %pefile%>NotCopy.txt
If Exist "%pepath%WXPE\*.WIM" XCopy "%pepath%WXPE\*.*" %UD%:\WXPE\ /e /h /q /r /c /y>nul
If Exist "%pepath%MINIPE\*.WIM" XCopy "%pepath%MINIPE\*.*" %UD%:\MINIPE\ /e /h /q /r /c /y>nul
If Exist "%pepath%*.WIM" XCopy "%pepath%*.*" %UD%:\%pepath:~-5% /e /h /q /r /c /y /exclude:NotCopy.txt>nul
For %%h In (Xyldr XyG4D.exe PELDR Config.sys NTDETECT.COM WinPE.SIF WinPE%FileExt%) Do attrib +r +h +s %UD%:\%%h>nul 2>nul
cls&Echo.&Echo WinPE 成功安装到U盘(USB移动硬盘)%UD%: 盘!按任意键重启计算机...&pause>nul
)
Goto ReBoot
:MBR_Mode
cls
Echo.
Echo 开始安装 GRUB 到硬盘MBR,请稍候...
For /f "delims=" %%i In ("%pefile%") Do Set pepath=%%~dpi&Set file=%%~nxi&Set FileExt=%%~xi
For %%n In (Xyldr PELDR NTDETECT.COM WinPE.SIF WinPE%FileExt%) Do attrib -r -h -s %p%:\%%n>nul 2>nul
if %k%#==# grubinst --mbr-disable-floppy --boot-file=Xyldr (%d%)
if not %k%#==# grubinst --mbr-disable-floppy --boot-prevmbr-first --time-out=3 --hot-key=%k% --boot-file=Xyldr (%d%)
=====================================================
If /i "%FileExt%"==".im_" Echo OsLoadOptions="/minint /fastdetect /rdpath=WinPE.IM_">>%p%:\WinPE.sif
If /i "%FileExt%"==".iso" Echo OsLoadOptions="/minint /fastdetect /rdexportascd /rdpath=WinPE.ISO">>%p%:\WinPE.sif
If /i "%FileExt%"==".is_" Echo OsLoadOptions="/minint /fastdetect /rdexportascd /rdpath=WinPE.IS_">>%p%:\WinPE.sif
If /i "%pefile%"=="%p%:\WinPE%FileExt%" (
For %%h In (Xyldr PELDR NTDETECT.COM WinPE.SIF WinPE%FileExt%) Do attrib +r +h +s %p%:\%%h>nul 2>nul
cls&Echo.&Echo 安装 GRUB 到硬盘MBR引导PE完成!按任意键重启计算机...&pause>nul
Goto ReBoot
)
If Exist %p%:\WinPE%FileExt% Ren %p%:\WinPE%FileExt% WinPE%FileExt%.old
XCopy "%pefile%" %p%:\ /h /q /r /c /y>nul&&attrib -r -s -h "%p%:\%file%">nul
If /i Not "%file%"=="WinPE%FileExt%" Ren "%p%:\%file%" WinPE%FileExt%
If exist "%pepath%外置程序" (
If exist d: XCopy "%pepath%外置程序" d:\外置程序\ /e /h /q /r /c /y>nul
If not exist d: XCopy "%pepath%外置程序" %p%:\外置程序\ /e /h /q /r /c /y>nul
)
If Exist "%pepath%*.WIM" (
echo %pefile%>NotCopy.txt
If exist d: XCopy "%pepath%*.*" d:\%pepath:~-5% /e /h /q /r /c /y /exclude:NotCopy.txt>nul
If not exist d: XCopy "%pepath%*.*" %p%:\%pepath:~-5% /e /h /q /r /c /y /exclude:NotCopy.txt>nul
)
If Exist "%pepath%WXPE\*.WIM" (
If exist d: XCopy "%pepath%WXPE\*.*" D:\WXPE\ /e /h /q /r /c /y>nul
If not exist d: XCopy "%pepath%WXPE\*.*" C:\WXPE\ /e /h /q /r /c /y>nul
)
If Exist "%pepath%MINIPE\*.WIM" (
If exist d: XCopy "%pepath%MINIPE\*.*" D:\MINIPE\ /e /h /q /r /c /y>nul
If not exist d: XCopy "%pepath%MINIPE\*.*" C:\MINIPE\ /e /h /q /r /c /y>nul
)
For %%h In (Xyldr PELDR NTDETECT.COM WinPE.SIF WinPE%FileExt%) Do attrib +r +h +s %p%:\%%h>nul 2>nul
cls&Echo.&Echo 安装 GRUB 到硬盘MBR引导PE完成!%file% 安装到 %p%: 盘。按任意键重启计算机...&pause>nul
Goto ReBoot
:NT_Mode
cls
Echo.
Echo 正在进行硬盘安装,请稍候...
For /f "delims=" %%i In ("%pefile%") Do Set pepath=%%~dpi&Set file=%%~nxi&Set FileExt=%%~xi
For %%h In (boot.ini %m% NTDETECT.COM NTLDR bootfont.bin PELDR WinPE.SIF WinPE%FileExt%) Do attrib -r -h -s %p%:\%%h>nul 2>nul
Copy %m% %p%:\ /y>nul
Copy NTLDR %p%:\ /y>nul
Copy PELDR %p%:\ /y>nul
Copy WinPE.SIF %p%:\ /y>nul
Copy Bootfont.bin %p%:\ /y>nul
Copy NTDETECT.COM %p%:\ /y>nul
inifile.exe %p%:\boot.ini [boot loader] timeout=3
inifile.exe %p%:\boot.ini [operating systems] C:\%m%="[1;32mWindows PE[1;34m 应急系统 [1;33mby 逍遥浪子"
sfk replace "/LXPE/%sysdir%/" -file %p%:\PELDR -yes>nul 2>nul
inifile.exe %p%:\WinPE.sif [SetupData] /remove
===============================================
cls&Echo.&Echo WinPE 已成功安装到 %p%: 盘!按任意键重启计算机...&pause>nul
Goto ReBoot
)
If Exist %p%:\WinPE%FileExt% Ren %p%:\WinPE%FileExt% WinPE%FileExt%.old
XCopy "%pefile%" %p%:\ /h /q /r /c /y>nul&&attrib -r -s -h "%p%:\%file%">nul
If /i Not "%file%"=="WinPE%FileExt%" Ren "%p%:\%file%" WinPE%FileExt%
If exist "%pepath%外置程序" (
If exist d: XCopy "%pepath%外置程序" d:\外置程序\ /e /h /q /r /c /y>nul
If not exist d: XCopy "%pepath%外置程序" %p%:\外置程序\ /e /h /q /r /c /y>nul
)
If Exist "%pepath%*.WIM" (
echo %pefile%>NotCopy.txt
If exist d: XCopy "%pepath%*.*" d:\%pepath:~-5% /e /h /q /r /c /y /exclude:NotCopy.txt>nul
If not exist d: XCopy "%pepath%*.*" %p%:\%pepath:~-5% /e /h /q /r /c /y /exclude:NotCopy.txt>nul
)
If Exist "%pepath%WXPE\*.WIM" (
If exist d: XCopy "%pepath%WXPE\*.*" D:\WXPE\ /e /h /q /r /c /y>nul
If not exist d: XCopy "%pepath%WXPE\*.*" C:\WXPE\ /e /h /q /r /c /y>nul
)
=========================================
Echo 正在Vista系统上安装PE,请稍候...
SET MyVID=
set MenuInfo=Windows PE 应急系统 by 逍遥浪子
bcdedit.exe /export %p%:\boot\bcd_old.bak
for /f "tokens=2 delims={}" %%i in ('bcdedit.exe /create /d "%MenuInfo%" /application bootsector') do set MyVID={%%i}
bcdedit.exe /set %MyVID% device %p%: >nul
bcdedit.exe /set %MyVID% path %p%:\Xyldr.mbr >nul
bcdedit.exe /displayorder %MyVID% /addlast >nul
bcdedit.exe /timeout 3 >nul
For /f "delims=" %%i In ("%pefile%") Do Set pepath=%%~dpi&Set file=%%~nxi&Set FileExt=%%~xi
For %%h In (Xyldr.mbr Xyldr NTDETECT.COM PELDR WinPE.SIF WinPE%FileExt%) Do attrib -r -h -s %p%:\%%h>nul 2>nul
========================================================
if not exist %p%:\NTDETECT.COM Copy NTDETECT.COM %p%:\ /y>nul
sfk replace "/LXPE/%sysdir%/" -file %p%:\PELDR -yes>nul 2>nul
inifile.exe %p%:\WinPE.sif [SetupData] /remove
inifile.exe %p%:\WinPE.sif [SetupData]
inifile.exe %p%:\WinPE.sif [SetupData] BootDevice="ramdisk(0)"
inifile.exe %p%:\WinPE.sif [SetupData] BootPath="\%Sysdir%\System32\"
If /i "%FileExt%"==".img" Echo OsLoadOptions="/minint /fastdetect /rdpath=WinPE.IMG">>%p%:\WinPE.sif
If /i "%FileExt%"==".im_" Echo OsLoadOptions="/minint /fastdetect /rdpath=WinPE.IM_">>%p%:\WinPE.sif
If /i "%FileExt%"==".iso" Echo OsLoadOptions="/minint /fastdetect /rdexportascd /rdpath=WinPE.ISO">>%p%:\WinPE.sif
If /i "%FileExt%"==".is_" Echo OsLoadOptions="/minint /fastdetect /rdexportascd /rdpath=WinPE.IS_">>%p%:\WinPE.sif
If /i "%pefile%"=="%p%:\WinPE%FileExt%" (
For %%h In (Xyldr.mbr Xyldr NTDETECT.COM PELDR WinPE.SIF WinPE%FileExt%) Do attrib +r +h +s %p%:\%%h>nul 2>nul
cls&Echo.&Echo WinPE 已成功安装到 %p%: 盘!按任意键重启计算机...&pause>nul
Goto ReBoot
)
If Exist %p%:\WinPE%FileExt% Ren %p%:\WinPE%FileExt% WinPE%FileExt%.old
=================================
If exist d: XCopy "%pepath%*.*" d:\%pepath:~-5% /e /h /q /r /c /y /exclude:NotCopy.txt>nul
If not exist d: XCopy "%pepath%*.*" %p%:\%pepath:~-5% /e /h /q /r /c /y /exclude:NotCopy.txt>nul
)
If Exist "%pepath%WXPE\*.WIM" (
If exist d: XCopy "%pepath%WXPE\*.*" D:\WXPE\ /e /h /q /r /c /y>nul
If not exist d: XCopy "%pepath%WXPE\*.*" C:\WXPE\ /e /h /q /r /c /y>nul
)
If Exist "%pepath%MINIPE\*.WIM" (
=
cls
color 1c
echo.
echo.
echo.
echo 警告:这样会删除安装时复制的所有文件或目录!!!真的要卸载吗?
echo.
echo.
echo.
set k=
set /p k= 卸载请按 Y 键(其它键自动退出):
if /i not "%k%"=="Y" goto Quit
For %%k In (c d e f g h i j k l m n o p q r s t u v w) Do If Exist %%k:\Avldr Set p=%%k&&goto del_Avldr
cls&echo.&echo.&echo 已卸载或没装过!安装请重新运行程序,按任意键退出...&pause>nul&goto Quit
:del_Xyldr
if exist %p%:\boot.ini attrib -h -s -r %p%:\boot.ini
if exist %p%:\boot\grub\IGhost.img (
set Xy[1;32m逍遥[1;34m 一键恢复 [1;33mby 逍遥浪子""
if exist %p%:\boot.ini inifile %p%:\boot.ini [operating systems] %XyOneKey%
del /f /q /a %p%:\boot.ini.old>nul 2>nul
del /f /q /a %p%:\Xyldr.old>nul 2>nul
) else (
if exist %p%:\boot.ini inifile %p%:\boot.ini [operating systems] %p%:\Xyldr=
del /f /q /a %p%:\Xyldr
)
if exist %p%:\boot.ini attrib +h +s +r %p%:\boot.ini
if not exist %p%:\boot.ini if not exist %p%:\boot\bcd set delntd=Yes
if "%delntd%"#=="Yes"# if exist %p%:\NTDETECT.COM del /f /q /a %p%:\NTDETECT.COM
If Exist %p%:\Xyldr.mbr del /f /q /a %p%:\Xyldr.mbr
if Exist %p%:\boot\bcd_old.bak bcdedit.exe /import %p%:\boot\bcd_old.bak
if Exist %p%:\boot\bcd_old.bak del /f /q /a %p%:\boot\bcd_old.bak
for /f "skip=3 delims== tokens=3" %%i in (%p%:\Winpe.sif) do set file=%%i
set file=%file:"=%
del /f /q /a %p%:\%file%
if exist %p%:\%file%.old Ren %p%:\%file%.old %file%
if exist %p%:\peldr del /f /q /a %p%:\peldr
if exist %p%:\WinPE.sif del /f /q /a %p%:\WinPE.sif
cls
echo.
echo.
echo WinPE 系统 →已从你的电脑 %p%: 盘中移除!按任意键退出...&pause>nul
goto Quit
:del_XyG4D
for /f "skip=3 delims== tokens=3" %%i in (%u%:\Winpe.sif) do set file=%%i
set file=%file:"=%
del /f /q /a %u%:\%file%
if exist %u%:\%file%.old Ren %u%:\%file%.old %file%
if exist %u%:\peldr del /f /q /a %u%:\peldr
if exist %u%:\NTDETECT.COM del /f /q /a %u%:\NTDETECT.COM
if exist %u%:\config.sys del /f /q /a %u%:\config.sys
if exist %u%:\Config.sys.old Ren %u%:\Config.sys.old Config.sys
if exist %u%:\WinPE.sif del /f /q /a %u%:\WinPE.sif
if not exist %u%:\boot\grub\IGhost.img del /f /q /a %u%:\XyG4D.exe
cls
echo.
echo.
echo WinPE 系统 →已从你的电脑 %u%: 盘中移除!按任意键退出...&pause>nul
goto Quit
:del_Avldr
if exist %p%:\boot.ini attrib -h -s -r %p%:\boot.ini
if exist %p%:\boot.ini inifile %p%:\boot.ini [operating systems] %p%:\Avldr=
if exist %p%:\boot.ini attrib +h +s +r %p%:\boot.ini
for /f "skip=3 delims== tokens=3" %%i in (%p%:\Winpe.sif) do set file=%%i
set file=%file:"=%
del /f /q /a %p%:\%file%
if exist %p%:\%file%.old Ren %p%:\%file%.old %file%
if exist %p%:\peldr del /f /q /a %p%:\peldr
if exist %p%:\WinPE.sif del /f /q /a %p%:\WinPE.sif
del /f /q /a %p%:\Avldr
cls
echo.
echo.
echo WinPE 系统 →已从你的电脑 %p%: 盘中移除!按任意键退出...&pause>nul
goto Quit
=====================================================
:Quit
cd..
rd /s/q WinPESetup>nul 2>nul
Cd\
rd /s/q %Temp%\WinPESetup>nul 2>nul
Del /f /q %0>nul 2>nul
[ 本帖最后由 uepon 于 2008-7-31 13:51 编辑 ] |
|