I am wondering if there is any way to create a batch file that can edit a line in an XML document. The line would be identified by the preceding line. the idea would be as
sure, natively, you can use batch, but i recommend you to learn and use vbscript instead
Set objFS=CreateObject("Scripting.FileSystemObject")
strFile = WScript.Arguments.Item(0)
strUserValue= WScript.Arguments.Item(1)
Set objFile = objFS.OpenTextFile(strFile)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If InStr(strLine,"Csetting name") >0 And _
InStr(strLine,"BaseDirectory")> 0 And _
InStr(strLine,"serializeAs=") > 0 Then
strLine=strLine & vbCrLf & "" & strUserValue & " "
End If
WScript.Echo strLine
Loop
save the script as edit.vbs and in your batch
c:\test> cscript //nologo edit.vbs file "user value"
vbscript is the best you got besides cripple batch, if you hate the idea of using other tools like gawk/sed/Python/Perl or other xml parsers/writers. Otherwise, you should consider using these better tools.