无忧启动论坛

标题: 用批处理如何修改BOOT.INI内的内容 [打印本页]

作者: 都市浪子666    时间: 2008-2-27 19:36
标题: 用批处理如何修改BOOT.INI内的内容
我想把   default=multi(0)disk(0)rdisk(0)partition(1)\windows
改成       default=grldr
别的内容不变.请问用批处理如何实现
作者: 不才    时间: 2008-2-27 21:07
嘿嘿,翻翻旧帖,有讨论过滴。
作者: haiou327    时间: 2008-2-27 21:39
首先去BOOT的只读属性.
edit boot.ini

[ 本帖最后由 haiou327 于 2008-2-27 10:38 PM 编辑 ]
作者: 都市浪子666    时间: 2008-2-28 17:05
谢谢楼上的二位。
现在已经解决,
现在是把  default=multi(0)disk(0)rdisk(0)partition(1)\windows
改写成了  default=c:\phldr


偶的代码:
@echo off

if not exist c:\boot.ini goto :eof
attrib -s -h -r c:\boot.ini
if exist c:\boot.bak del c:\boot.bak  2> nul
if exist c:\boot.new del c:\boot.new  2> nul
copy c:\boot.ini c:\boot.bak


for /f "delims=" %%l in (c:\boot.ini) do (
    echo.%%l | find/i "default=multi(0)disk(0)rdisk(0)partition(1)\windows">nul && echo default=c:\phldr||echo %%l
)>>c:\boot.new
attrib -s -h -r c:\boot.ini
copy c:\boot.new c:\boot.ini>nul
attrib +s +h +r c:\boot.ini
del c:\boot.new




欢迎光临 无忧启动论坛 (http://bbs.c3.wuyou.net/) Powered by Discuz! X3.3