looking for vbscript to edit batch file to change values in it.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
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
Answered 09/16/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
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
Answered 09/16/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
thnx murali.
Answered 09/16/2010 by: er.hsingh
Orange Senior Belt

Please log in to comment
0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Why bother? Why not have the VBS do what the BAT is doing?!?

Is it me? Is it? Really?
Answered 09/17/2010 by: VBScab
Red Belt

Please log in to comment
0
This file has lot of values written at install time (vendors MSI)
Needed this batch file to be there, vbscript was required to change the values.
Answered 09/17/2010 by: er.hsingh
Orange Senior Belt

Please log in to comment
0
Even better! A vendor MSI which writes a batch file. LOL...how do they get away with this cr@p?
Answered 09/17/2010 by: VBScab
Red Belt

Please log in to comment
0
so vendors still don't seem to know what to do.. sigh didnt we cover this stuff like 5-6 years ago?

you should probably be using CustomActionData in there somewhere as well. If you want to do it properly anyways .
Answered 09/21/2010 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity