QUOTE (Yzöwl @ Jul 14 2008, 12:28 PM)

Ideally this requires a third party tool!
I respectfully disagree. While I don't normally like to reinvent the wheel for nothing (e.g. you don't see me try to clone grep or such), this is trivial to do.
In fact, one could write a complete clone of IniMod in very little time, in basically any language (JScript/VBScript included)
QUOTE (amio @ Jul 14 2008, 10:35 AM)

For instance DOSNET.INF
I would like to use sed or other command Remove:
[CmdConsFiles]
(lines here)
Take [CmdConsFiles] as the key words deletion
Easy! Here's a 5 minute quickie that does exactly that, written in vbscript (any other language you prefer, just ask, it would only take a couple minutes to translate):
CODE
Option Explicit
Dim fso, f, filename, section, data, i, s, skip
ReDim data(500)
i=0
skip = False
filename = Wscript.Arguments(0)
section = Wscript.Arguments(1)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filename, 1) '1=ForReading
Do Until f.AtEndOfStream
s = f.ReadLine
If skip=True And Left(s,1) = "[" Then skip=False
If s = "[" + section + "]" Then skip=True
If skip=False Then
data(i) = s
i=i+1
If i = UBound(data) Then ReDim Preserve data(i+50)
End If
If s = "" Then skip = False
Loop
f.Close
Set f = fso.CreateTextFile(filename, True)
f.WriteLine Join(data, vbCrLf)
f.Close
Save that as delsect.vbs or such, and then to do exactly what you said, you'd use this command line:
delsect.vbs DOSNET.INF CmdConsFiles
And that will delete the [CmdConsFiles] section altogether from DOSNET.INF -- simple as that.