无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 7116|回复: 12
打印 上一主题 下一主题

如何用批处理,删除boot.ini里面的这些信息

[复制链接]
跳转到指定楼层
1#
发表于 2007-5-21 16:10:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
boot.ini里面的信息如下:
c:\grldr= "1 Key Ghost"
c:\grldr= "1 Key Ghost"

需要批处理命令删除掉,看了论坛的其它文章,不是很懂啊,看不明白,只看到有个添加参数的批处理,删除如何来做呢?
2#
发表于 2007-5-21 16:26:16 | 只看该作者
INIFILE.COM

看看这个行不行
回复

使用道具 举报

3#
发表于 2007-5-21 16:27:17 | 只看该作者
检索帖子,会找到的。
回复

使用道具 举报

4#
 楼主| 发表于 2007-5-21 16:29:39 | 只看该作者
不采用第三方软件的话,如何做到?
回复

使用道具 举报

5#
发表于 2007-5-21 17:03:44 | 只看该作者
这时我在用的批处理中的一部分。
attrib -h -r -s c:\boot.ini  >nul
if exist c:\boot.ggh attrib -h -r -s c:\boot.ggh >nul&&del c:\boot.ggh >nul
ren c:\boot.ini boot.ggh >nul
findstr /b /i /v /c:"C:\GHLDR=" c:\boot.ggh>c:\boot.ini
notepad c:\boot.ini  >nul
cls
echo.
echo  请确认修改过的boot.ini文件内容。
echo.
echo  无误的话,按任意键结束。
pause>nul
attrib +h +r +s c:\boot.ini  >nul
del c:\boot.ggh  >nul
回复

使用道具 举报

6#
发表于 2007-5-21 17:05:26 | 只看该作者
cmd下测试通过
  1. @echo off
  2. attrib -s -r -h %SystemDrive%\boot.ini
  3. if exist %SystemDrive%\boot2.iii   del %SystemDrive%\boot2.iii
  4. for /f "skip=2 tokens=* delims=$$$"  %%i in ('find /v /i "1 Key Ghost" c:\boot.ini')  do  echo %%i >>c:\boot2.iii
  5. del %SystemDrive%\boot.ini
  6. ren %SystemDrive%\boot2.iii  boot.ini
  7. attrib +s +r +h %SystemDrive%\boot.ini
  8. pause
  9. exit
复制代码

[ 本帖最后由 wjh6088 于 2007-5-21 05:18 PM 编辑 ]
回复

使用道具 举报

7#
发表于 2007-5-21 17:41:00 | 只看该作者
@echo off
type %systemdrive%\boot.ini>%systemdrive%\boot.bak
attrib -h -r -s %systemdrive%\boot.ini
type %systemdrive%\boot.bak|find "c:\grldr=" /i /v>%systemdrive%\boot.ini
attrib +s +r +h %systemdrive%\boot.ini
回复

使用道具 举报

8#
 楼主| 发表于 2007-5-22 10:32:56 | 只看该作者
不错,findstr这个命令太好了,原理利用重新打印生成新文件。
回复

使用道具 举报

9#
发表于 2007-5-22 14:45:40 | 只看该作者
原帖由 terse 于 2007-5-21 05:41 PM 发表
@echo off
type %systemdrive%\boot.ini>%systemdrive%\boot.bak
attrib -h -r -s %systemdrive%\boot.ini
type %systemdrive%\boot.bak|find "c:\grldr=" /i /v>%systemdrive%\boot.ini
attrib +s +r +h % ...


type |find这个很简介
回复

使用道具 举报

10#
发表于 2007-6-1 11:59:52 | 只看该作者
原帖由 terse 于 2007-5-21 05:41 PM 发表
@echo off
type %systemdrive%\boot.ini>%systemdrive%\boot.bak
attrib -h -r -s %systemdrive%\boot.ini
type %systemdrive%\boot.bak|find "c:\grldr=" /i /v>%systemdrive%\boot.ini
attrib +s +r +h % ...



这个是最清晰明了、最简单也是最好的答案。
回复

使用道具 举报

11#
发表于 2007-6-1 21:22:59 | 只看该作者
拜托,没进windows哪来的%Systemdrive%?
回复

使用道具 举报

12#
发表于 2007-6-1 21:56:11 | 只看该作者
原帖由 netwinxp 于 2007-6-1 09:22 PM 发表
拜托,没进windows哪来的%Systemdrive%?

楼主没要求是dos下,因此假定是cmd环境。
回复

使用道具 举报

13#
发表于 2007-7-8 22:37:54 | 只看该作者

在 cmd下

有一个Bootcfg 命令 专门调整 boot.ini设置
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-26 11:00

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表