Batch coding was never meant to do much more than run programs sequentially. Using batch as a programming language is like using a spoon to dig the Panama Canal. Yes, it can be done, but it's not the best tool for the job.
Const ForReading = 1
Const ForWriting = 2
Const FileIn = "c:\test.txt"
Const FileOut = "c:\test.txt" '<== Change to prevent overwrite of original file
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(FileIn, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "Charlie ", "Bob ")
Set objFile = objFSO.OpenTextFile(FileOut, ForWriting)
objFile.WriteLine strNewText
objFile.Close
Save the script with a vbs extension and run from the command line as: cscript scriptname.vbs. As written, the script will overwrite the original file. You can modify this by changing the FileOut parameter.
Just my 2˘ worth. 8-)