For batch processing, I'm a layman. I saw the following code on Wuyou, which was originally given by a expert here.
The use of this code is to modify BOOT.INI when changing the XP boot screen. I tested it and it's very good.
@echo off
if exist boot.new del boot.new
if not exist boot.ini goto :eof
for /f "delims=" %%l in (boot.ini) do (
echo.%%l | find /i "/fastdetect" | find /v /i "/kernel">nul && echo %%l /kernel=kernel.exe||echo %%l
)>>boot.new
attrib -s -h -r boot.ini
copy boot.new boot.ini>nul
attrib +s +h +r boot.ini
But there are also deficiencies. For multi - system, it will add /kernel=kernel.exe after /fastdetect. If you start to another system next time, it can't start. Also, the boot screens of 2000, XP, 2003 are different, and it can't judge the system.
I wonder if batch processing can be used to do the following points?
1. Judge whether it is the XP system. If yes, carry out the following operations. If not, give a warning and then exit.
2. If it is the XP system, judge which partition the system is installed in, and then modify the corresponding system in BOOT.INI.
3. When modifying, automatically add a startup item of the current system at the end.
I'm too bad to explain clearly. Give an example.
For example, under BOOT.INI is like this
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Standard Lite" /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP" /fastdetect
I just want to add something after multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP" /fastdetect. Can it be done?
Thank you for the answer.
The use of this code is to modify BOOT.INI when changing the XP boot screen. I tested it and it's very good.
@echo off
if exist boot.new del boot.new
if not exist boot.ini goto :eof
for /f "delims=" %%l in (boot.ini) do (
echo.%%l | find /i "/fastdetect" | find /v /i "/kernel">nul && echo %%l /kernel=kernel.exe||echo %%l
)>>boot.new
attrib -s -h -r boot.ini
copy boot.new boot.ini>nul
attrib +s +h +r boot.ini
But there are also deficiencies. For multi - system, it will add /kernel=kernel.exe after /fastdetect. If you start to another system next time, it can't start. Also, the boot screens of 2000, XP, 2003 are different, and it can't judge the system.
I wonder if batch processing can be used to do the following points?
1. Judge whether it is the XP system. If yes, carry out the following operations. If not, give a warning and then exit.
2. If it is the XP system, judge which partition the system is installed in, and then modify the corresponding system in BOOT.INI.
3. When modifying, automatically add a startup item of the current system at the end.
I'm too bad to explain clearly. Give an example.
For example, under BOOT.INI is like this
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Standard Lite" /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP" /fastdetect
I just want to add something after multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP" /fastdetect. Can it be done?
Thank you for the answer.

