中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 07:04
47,811 topics / 349,897 posts / today 0 new / 48,256 members
GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » Script for installing/uninstalling GRUB4DOS in the boot entries of Windows 2000/xp/2003/vista
Printable Version  3,517 / 12
Floor1 lianjiang2004 Posted 2008-02-20 09:49
金牌会员 Posts 1,884 Credits 3,946
Scripts for Installing/Uninstalling Grub4DOS in the Boot Entries of Windows 2000/xp/2003/vista

Instructions:
1. The following installation/uninstallation scripts are simplified from my "GGhost One - Click Recovery 2008".
2. Support Windows 2000/xp/2003/vista. Support systems of any language.
3. The display name in the boot entry is "Start Grub4DOS", with a delay of 3 seconds, which can be modified by yourself.
4. All file copying is removed, please copy grldr.mbr, grldr and other required files by yourself.
5. The third - party tool inifile.exe is used under Windows 2000/xp/2003. (Requires to be placed in d:\ggho)
(Those who need it can download from the network disk: http://lianjiang2004.ys168.com/)

I am not good at batch processing, and the shown scripts are for reference only.
http://gghost.uu1001.com/
=============================
@Echo Off
if not %os%.==Windows_NT. goto not_nt
cls
mode con: cols=76 lines=26
Set TT=Installation Program by lianjiang
COLOR f9
TITLE %TT%
set gname=Start Grub4DOS
set gname2=\grldr.mbr
set winver=
set ggpath6=
set ggpath0=d:\ggho

set vid=
set timeout=3
ver|find /i " 5.1">nul &&set winver=winnt&&goto sub_001
ver|find /i " 6.0">nul &&set winver=vista&&goto sub_003
ver|find /i " 5.0">nul &&set winver=winnt&&goto sub_001
ver|find /i " 5.2">nul &&set winver=winnt&&goto sub_001
:not_nt
cls
echo.
echo Sorry, this software cannot be used in non - Windows 2k/xp/2k3/vista environments.
PING/n 5 127.1>NUL
Goto Exit
:sub_001
set ggpath6=
for %%B 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 exist %%B\boot.ini set ggpath6=%%B&&goto inst
)
goto inst
:sub_003
set ggpath6=%systemdrive%
:inst
if not %winver%#==winnt# goto vista_1
:winnt_1
attrib %ggpath6%\boot.ini -r -h -s >nul
if not exist %ggpath6%\g_boot.ini Copy %ggpath6%\boot.ini %ggpath6%\g_boot.ini /y >nul
%ggpath0%\inifile %ggpath6%\boot.ini timeout=%timeout% >nul
%ggpath0%\inifile %ggpath6%\boot.ini %ggpath6%%gname2%="%gname%" >nul
attrib %ggpath6%\boot.ini +r +h +s >nul
attrib %ggpath6%\g_boot.ini +r +h +s >nul
goto exit
:vista_1
if not exist %ggpath0%\nul md %ggpath0% >nul
bcdedit >%ggpath0%\temp_bcd.txt
type %ggpath0%\temp_bcd.txt | find "%gname%" >nul && goto vista_bcd
bcdedit /export "%ggpath0%\Bcd_Backup" >nul
bcdedit /create /d "%gname%" /application bootsector >%ggpath0%\vid.ini
for,/f,"tokens=2 delims={",%%i,In (%ggpath0%\vid.ini) Do (
set vida=%%i
)
for,/f,"tokens=1 delims=}",%%i,In ("%vida%") Do (
set vid={%%i}
)
echo %vid%>%ggpath0%\vid.ini
bcdedit /set %vid% device partition=%ggpath6% >nul
bcdedit /set %vid% path %gname2% >nul
bcdedit /displayorder %vid% /addlast >nul
:vista_bcd
bcdedit /timeout %timeout% >nul
:exit
cls
echo.
echo Installation completed.
echo.
echo Please copy grldr.mbr and grldr to %ggpath6% by yourself
Echo.
PING/n 3 127.1>NUL

=============================
@Echo Off
if not %os%.==Windows_NT. goto not_nt
cls
mode con: cols=76 lines=26
Set TT=Uninstallation Program by lianjiang
COLOR f9
TITLE %TT%
set winver=
set ggpath6=
set ggpath0=d:\ggho
set vid=
set timeout=3
ver|find /i " 5.1">nul &&set winver=winnt&&goto sub_001
ver|find /i " 6.0">nul &&set winver=vista&&goto sub_003
ver|find /i " 5.0">nul &&set winver=winnt&&goto sub_001
ver|find /i " 5.2">nul &&set winver=winnt&&goto sub_001
:not_nt
cls
echo.
echo Sorry, this software cannot be used in non - Windows 2k/xp/2k3/vista environments.
PING/n 5 127.1>NUL
Goto Exit
:sub_001
set ggpath6=
for %%B 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 exist %%B\boot.ini set ggpath6=%%B&&goto uninst_01
)
goto uninst_01
:sub_003
set ggpath6=%systemdrive%
:uninst_01
if not %winver%#==winnt# goto uninst_4
for,/f,"tokens=1",%%i,In (%ggpath0%\vid.ini) Do (
set vid=%%i
)
bcdedit /delete %vid% /cleanup >nul
bcdedit /timeout %timeout% >nul
goto uninst_4a
:uninst_4
attrib -h -r -s %ggpath6%\boot.ini >nul
if exist %ggpath6%\boot.ggh attrib -h -r -s %ggpath6%\boot.ggh >nul&&del %ggpath6%\boot.ggh >nul
ren %ggpath6%\boot.ini boot.ggh >nul
findstr /b /i /v /c:"%ggpath6%\grldr" %ggpath6%\boot.ggh>%ggpath6%\boot.ini
bootcfg /timeout %timeout% >nul
attrib +h +r +s %ggpath6%\boot.ini >nul
del %ggpath6%\boot.ggh >nul
if exist %ggpath6%\g_boot.ini attrib %ggpath6%\g_boot.ini -r -h -s >nul&&del %ggpath6%\g_boot.ini >nul
:uninst_4a
cls
echo.
echo Uninstallation completed.
Echo.
PING/n 3 127.1>NUL
Floor2 barton Posted 2008-02-20 12:38
中级用户 Posts 197 Credits 480 From 黄冈
Give it a support

Seeing if for in batch processing makes my head spin

o(∩_∩)o...
Floor3 newswan Posted 2008-02-22 21:38
初级用户 Posts 29 Credits 70
Support, take a look slowly...
Floor4 lianjiang2004 Posted 2008-02-23 10:44
金牌会员 Posts 1,884 Credits 3,946
The number of supporters is too small, heh heh.
Floor5 WLDNA Posted 2008-02-23 17:46
新手上路 Posts 5 Credits 10
Originally posted by lianjiang2004 at 2008-2-23 10:44 AM:
There are too few supporters, heh heh.



o(∩_∩)o...
Well, technology is definitely not that easy to understand, so there are naturally fewer people, heh heh
Hard work, even though I'm a novice, I still have to tackle it
Heh heh
Floor6 hnfeng Posted 2008-02-25 17:38
初级用户 Posts 36 Credits 89
INIFILE is well used!!!
(Previously, I found this tool in the DOS71 installation floppy disk, never paid attention to it, and it turns out it has quite a few functions. Thanks to the楼主!)

Originally, I wanted to make a batch script that is universal for DOS, WIN98, NT, ME, 2000, XP, 2003, Vista to add GRUB4DOS menu. It seems that it is best to be completed by the楼主.


It's dizzying to look at........

There seems to be a small bug in the楼主's program:

if not %os%.==Windows_NT. goto not_nt

:not_nt
cls
echo.
echo Sorry, this software cannot be used in non-Windows 2k/xp/2k3/vista environments.
PING/n 5 127.1>NUL
Goto Exit

:exit
cls
echo.
echo Installation completed.
echo.
echo Please copy grldr.mbr and grldr to %ggpath6% by yourself
Echo.
PING/n 3 127.1>NUL

In this way, even if it is judged that the system does not meet the requirements, it will still display the words "Installation successful...".


In addition, there seems to be another small problem:
There is no judgment on the highest operating system in the computer (I have been unable to succeed for this reason) and corresponding processing.
For example: If there are XP and Vista installed on the computer, when running the above program, if the user is in XP, the program will continue and install the GRUB4DOS menu in boot.ini instead of the boot menu of Vista. This may be a bit improper.


(Looking forward to the楼主 making a universal one...)
Floor7 lianjiang2004 Posted 2008-02-25 18:08
金牌会员 Posts 1,884 Credits 3,946
1. Regarding the prompt issue of judging non-NT systems, this is indeed a bug. I didn't pay attention when writing it. Thank you for pointing it out.
2. My handling method should be no problem. Judging the current system and performing installation is reasonable.
3. As for supporting DOS, 98, ME, etc., personally, I think it's basically meaningless.
Floor8 hnfeng Posted 2008-02-27 15:22
初级用户 Posts 36 Credits 89

2. My handling method should be no problem. Judging the current system and carrying out the installation is reasonable.


When the highest system in the computer is VISTA, but after adding the GRUB4DOS menu to BOOT.INI in XP, this menu will appear in both the VISTA and XP (BOOT.INI) menus. Personally, I feel this is unpleasant, or rather, not perfect.


3. As for supporting DOS, 98, ME, etc., personally, I think it is basically meaningless.

Indeed, as you said, I also think it is meaningless.
Floor9 lianjiang2004 Posted 2008-02-27 16:12
金牌会员 Posts 1,884 Credits 3,946
For this kind of dual - system installation method, if you feel uncomfortable with the appearance of two options, you don't need to install in Vista.
Floor10 429499381 Posted 2008-02-27 18:09
中级用户 Posts 202 Credits 452
I didn't install OneKey Recovery 2008. After running, I found a small problem as follows:

[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
C:\mxldr=MaxDOS v5.8s
C:\MAOTAO\MAOTAO.BIN="WinPE By: 老毛桃"
c:\grldr= grub 4d
c:\CGDos=Auto Ghost 1.

You will find that c:\grldr= grub 4d is missing a few words. I don't know if it's an isolated phenomenon.
Floor11 lianjiang2004 Posted 2008-02-27 18:23
金牌会员 Posts 1,884 Credits 3,946
The first time I saw a report of this situation. It seems there's no reason for it to happen, heh heh.
Might as well manually enter the line to add grldr in cmd and see.
It seems you've modified it yourself, not sure which parts you've changed.
Floor12 yaoxin1588 Posted 2008-03-08 19:25
初级用户 Posts 23 Credits 48
The grldr has the same name as the file that cracks Vista.
Floor13 lianjiang2004 Posted 2008-03-08 19:41
金牌会员 Posts 1,884 Credits 3,946
This is not a problem with grub, but rather a problem with the cracker randomly using file names.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023