因为boot.ini具有 系统+只读+隐藏 属性,所以要去掉这些属性之后才能对内容进行修改。对boot.ini操作具有危险性,所以以下代码把boot.ini备份为boot_bak.ini,放在系统根目录下,具有 只读+隐藏 属性,以方便恢复。请测试以下代码是否可行。
@echo off
attrib -s -h -r %systemdrive%\boot.ini
cd.>%systemdrive%\boot.txt
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (%systemdrive%\boot.ini) do (
set var=%%i
set "var=!var:5=3!"
set "var=!var:一键GHOST v8.3 Build 060903=="南阳赛维科技一键还原专用版"!"
echo !var!>>%systemdrive%\boot.txt
)
ren %systemdrive%\boot.ini boot_bak.ini
ren %systemdrive%\boot.txt boot.ini
attrib +s +h +r %systemdrive%\boot.ini
attrib +h +r %systemdrive%\boot_bak.ini
Last edited by namejm on 2006-9-18 at 09:51 ]