本帖最后由 yu2n 于 2015-1-8 11:53 编辑
回复 5# ygqiang
题目太大……还是说说你的BAT吧。
如果你自己忘了安装WinRAR……
如果你自己改了系统盘符,系统盘符不是 C: ,是 %SystemDrive% ……
如果你装了两个XP系统……
……
如果是给用户用呢?
感觉细节很多很烦是吧?感觉什么软件都不是尽善尽美了吧?
~自己喜欢就好。
安装脚本,供参考:- cls&@echo off
- title %~n0
-
- ::@chcp 950
- @echo off
- title -- Install Grub4Dos Boot Menu -- [Win XP/2003/NT4]
- color 0b
- call :_main
- :: setlocal enableDelayedExpansion
-
- :: Get Input
- goto :eof
- :_main
- :: Set Path
- call :_set_path
- cls
- echo.
- echo, Please enter the installation path, the sample is as follows^:
- echo, Local Drive^: C^:
- echo, UNC Drive^: \\PC002\C$
- echo.
- set /p "wkDir=Input Work Drive:> "
- if not exist "%wkDir%" call :_error_exit "Work Drive Not Found!"
- if not exist "%wkDir%\windows" call :_error_exit "Work Drive Not Found!"
- if not exist "%wkDir%\boot.ini" call :_error_exit "Work Drive Not Found!"
-
- call :_uninstall
- echo.
- echo,UnIntall Grub4Dos Done^! ^$_^$
- echo.
-
- set /p "p=> Install Grub4Dos ... " <nul & pause
- call :_install
- echo.
- echo,Install Grub4Dos Done^! ^^_^^
- echo.
-
- set /p "p=> Install 0pe ... " <nul & pause
- call :_install_0pe
- echo.
- echo,Install 0PE Done^! ^^_^^
- echo.
- pause
- goto :eof
-
-
-
-
- :: Install
- goto :eof
- :_install
- if not exist "%wkDir%\boot.ini.bak_g4d" (
- attrib -a -h -r -s "%wkDir%\boot.ini"
- call :_xcopy "%wkDir%\boot.ini" "%wkDir%\boot.ini.bak_g4d"
- )
- call :_xcopy "%meDir%\boot.ini" "%wkDir%\boot.ini"
- call :_xcopy "%meDir%\grldr" "%wkDir%\grldr"
- call :_xcopy "%meDir%\boot" "%wkDir%\boot"
- goto :eof
-
-
- goto :eof
- :_install_0pe
- call :_xcopy "%meDir%\0pe\0PE.ISO" "%wkDir%\boot\pe\0PE.ISO"
- call :_xcopy "%meDir%\0pe\0PE.ISO.txt" "%wkDir%\boot\pe\0PE.ISO.txt"
- goto :eof
-
-
- goto :eof
- :_uninstall
- if exist "%wkDir%\boot.ini.bak_g4d" (
- attrib -a -h -r -s "%wkDir%\boot.ini"
- call :_xcopy "%wkDir%\boot.ini.bak_g4d" "%wkDir%\boot.ini"
- del /a /f /q "%wkDir%\boot.ini.bak_g4d"
- attrib +a +h +r +s "%wkDir%\boot.ini"
- )
- if exist "%wkDir%\grldr" del /a /f /q "%wkDir%\grldr"
- if exist "%wkDir%\boot" rd /s /q "%wkDir%\boot"
- goto :eof
-
-
- goto :eof
- :_xcopy
- if not exist "%~1" goto :eof
- echo.
- ((pushd "%~1" >nul 2>nul) && (
- echo,[Folder] %~1
- xcopy /d /e /v /c /i /h /r /y /z "%~1" "%~2"
- popd
- )) || (
- echo,[File] %~1
- copy /v /y /z "%~1" "%~2"
- )
- goto :eof
-
-
- rem --set Path
- goto :eof
- :_set_path
- set "meName=%~n0"
- set "meDir=%~dp0"
- set "meDir=%MeDir:~0,-1%"
- set "meLog=%MeDir%\%MeName%.log"
- set "binPath=%MeDir%\bin"
- set "pathBak=%Path%"
- set "path=%pathBak%;%MeDir%;%binPath%"
- goto :eof
-
-
- goto :eof
- :_error_exit
- if "%~1" neq "" (
- echo,[Error] %~1
- ) else (
- if %ERRORLEVEL% neq 0 (echo,[Error] %ERRORLEVEL%)
- )
- pause
- exit
复制代码 文件列表,供参考:- 卷 VBOX_D_DRIVE 的文件夹 PATH 列表
- 卷序列号为 7C67-2B0F
- E:\DATA\APP\SYSTEM\BOOT_GRUB\GRUB_BOOT
- │ boot.ini
- │ grldr
- │ install_grub4dos.bat
- │
- ├─0pe
- │ 0PE.ISO
- │ 0PE.ISO.txt
- │
- └─boot
- │ HDTune.winpe.7z.exe
- │
- └─grub
- │ menu.lst
- │ unifont.hex.gz
- │ wallpaper.lzma
- │
- ├─dos
- │ dir.txt
- │ Maxs.sys
- │ Memdisk.gz
- │ Memtest.iso
- │ ReadMe.txt
- │
- ├─others.tools
- │ BOOTICEx86v1.321.exe.7z
- │ grldr
- │ grldr.mbr
- │ grldr~pwd_se
- │ WINNT5.X_NTLDR.7z
- │
- └─pe
- 0PE.iso.log
- dir.txt
- ReadMe.txt
- Ton8PE_V5.0_ISO.txt
- TonPE.iso
- V7PXE-g115.zip
-
复制代码
|