Deleting the /kernel switch in BOOT.INI

Microsoft Windows xp professional w/serv...
June 9, 2010 at 08:09:58
Specs: Windows XP
Hi, I really need to remove the switch /kernel from all the boot.ini files on our network. This switch could be on different lines within the .ini so I need a "find and delete" batch file
that will search for the text and just blank it out. Have searched for hours online for this and now have a very sore forehead, so any help would be gratefully received! I plan to deploy this by SMS 2003 if possible. Thanks!


See More: Deleting the /kernel switch in BOOT.INI

Report •


#1
June 9, 2010 at 11:12:39
@echo off>boot.new & setlocal enabledelayedexpansion
for /f "tokens=*" %%a in (boot.ini) do (
set line=%%a
set line=!line:/kernel=!
>> boot.new echo !line!
)
:: move /y boot.new boot.ini
::------ end
not tested!

Report •

#2
June 9, 2010 at 11:32:10
nbrane: not tested!
Don't forget to remove the +S, +H, and the +R before trying to overwrite boot.ini.

Also, if it's being deployed over AD, the script will probably start out in %systemroot%\system32.


Report •

#3
June 9, 2010 at 23:51:21
Thanks Nbrane! Have managed to get it all working now - just need to test network deployment and jobs a good one! Much appreciated.

Report •
Related Solutions


Ask Question