vbscript to edit batch file
looking for vbscript to edit batch file to change values in it.
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
murali.bhat
14 years ago
Open the file as text file. Use the REPLACE command to change.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 1)
objTextFile.Close
strData = objTextFile .ReadAll
strData = REPLACE (strData, OLD_VALUE,NEW_VALUE)
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 2)
objTextFile.Writeline strData
objTextFile.Close
Set objFSO = Nothing
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 1)
objTextFile.Close
strData = objTextFile .ReadAll
strData = REPLACE (strData, OLD_VALUE,NEW_VALUE)
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 2)
objTextFile.Writeline strData
objTextFile.Close
Set objFSO = Nothing
Posted by:
murali.bhat
14 years ago
Correction.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 1)
strData = objTextFile .ReadAll
objTextFile.Close
strData = REPLACE (strData, OLD_VALUE,NEW_VALUE)
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 2)
objTextFile.Writeline strData
objTextFile.Close
Set objFSO = Nothing
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 1)
strData = objTextFile .ReadAll
objTextFile.Close
strData = REPLACE (strData, OLD_VALUE,NEW_VALUE)
Set objTextFile = objFSO.OpenTextFile (FILE_LOC, 2)
objTextFile.Writeline strData
objTextFile.Close
Set objFSO = Nothing
Posted by:
anonymous_9363
14 years ago
Posted by:
er.hsingh
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
jmcfadyen
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.