Under XP, you can directly modify boot.ini to add a GRUB4DOS entry, but it's not that simple under Vista.
Since both the company and home computers are XP + Vista, I experimented with GURB4DOS functions many times a few days ago. Previously, I added this menu item manually. Today, I made a batch script and share it. To prevent newbies..., I added some junk at the front.
The following batch script will automatically add the GRUB4DOS boot entry to the Vista boot menu:
===== Add_GRUB4DOS_Menu.bat =====
@echo off
echo This batch script automatically adds the GRUB4DOS boot entry to the Vista system's boot menu.
echo If it's not a single Vista (there are also XP, 2K), it must be run under Vista.
echo Also, it needs to be run as an administrator.
echo .
pause
ver | find "6.0." > NUL && goto START
ver | find "XP" > NUL && goto XP2K
ver | find "2000" > NUL && goto XP2K
goto EXIT
:XP2K
echo Cannot run this batch script in WinXP or Win2000.
goto EXIT
REM ============= The above content is purely...... ==============
:START
cls
bcdedit | find "\grldr.mbr" > NUL && echo There is already grub4dos in the boot entry, no need to install repeatedly.&& goto EXIT
bcdedit /create /d "Boot From GRUB4DOS" /application bootsector >GrubID.txt
rem The above GRUB menu name to be added can be modified to "GRUB For DOS", "DOS + GHOST", etc.
for /f "tokens=2" %%i in (GrubID.txt) do set GrubID=%%i
del GrubID.txt > NUL
bcdedit /set %GrubID% device partition=%SystemDrive%
bcdedit /set %GrubID% path \grldr.mbr
bcdedit /displayorder %GrubID% /addlast
echo .
echo The above should have 3 "Operation completed successfully."
echo .
echo Please copy grldr.mbr to %SystemDrive%\ by yourself
echo .
echo Please copy grldr to C:\ by yourself
echo .
echo According to needs, please copy other related files by yourself, such as menu.lst, fonts, memdisk.gz and background pictures, etc., to the corresponding positions.
:EXIT
====== THE END =====
Everyone may use GRUB4DOS in different ways, so there is no automatic copying of grldr.mbr and other files. It's still safer to copy them yourself.
[ Last edited by hnfeng on 2008-1-30 at 01:09 PM ]
Since both the company and home computers are XP + Vista, I experimented with GURB4DOS functions many times a few days ago. Previously, I added this menu item manually. Today, I made a batch script and share it. To prevent newbies..., I added some junk at the front.
The following batch script will automatically add the GRUB4DOS boot entry to the Vista boot menu:
===== Add_GRUB4DOS_Menu.bat =====
@echo off
echo This batch script automatically adds the GRUB4DOS boot entry to the Vista system's boot menu.
echo If it's not a single Vista (there are also XP, 2K), it must be run under Vista.
echo Also, it needs to be run as an administrator.
echo .
pause
ver | find "6.0." > NUL && goto START
ver | find "XP" > NUL && goto XP2K
ver | find "2000" > NUL && goto XP2K
goto EXIT
:XP2K
echo Cannot run this batch script in WinXP or Win2000.
goto EXIT
REM ============= The above content is purely...... ==============
:START
cls
bcdedit | find "\grldr.mbr" > NUL && echo There is already grub4dos in the boot entry, no need to install repeatedly.&& goto EXIT
bcdedit /create /d "Boot From GRUB4DOS" /application bootsector >GrubID.txt
rem The above GRUB menu name to be added can be modified to "GRUB For DOS", "DOS + GHOST", etc.
for /f "tokens=2" %%i in (GrubID.txt) do set GrubID=%%i
del GrubID.txt > NUL
bcdedit /set %GrubID% device partition=%SystemDrive%
bcdedit /set %GrubID% path \grldr.mbr
bcdedit /displayorder %GrubID% /addlast
echo .
echo The above should have 3 "Operation completed successfully."
echo .
echo Please copy grldr.mbr to %SystemDrive%\ by yourself
echo .
echo Please copy grldr to C:\ by yourself
echo .
echo According to needs, please copy other related files by yourself, such as menu.lst, fonts, memdisk.gz and background pictures, etc., to the corresponding positions.
:EXIT
====== THE END =====
Everyone may use GRUB4DOS in different ways, so there is no automatic copying of grldr.mbr and other files. It's still safer to copy them yourself.
[ Last edited by hnfeng on 2008-1-30 at 01:09 PM ]
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| 429499381 | +2 | 2008-01-30 01:10 |

