This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bw:vbscript_tool [2020/05/20 16:50] akoehler [Day of the week (1=Sun - 7=Sat)] |
bw:vbscript_tool [2022/08/02 16:42] (current) akoehler |
||
|---|---|---|---|
| Line 518: | Line 518: | ||
| END IF | END IF | ||
| </ | </ | ||
| + | ==== Find and Replace seconds of a text file ==== | ||
| + | < | ||
| + | Const ForReading = 1 | ||
| + | Const ForWriting = 2 | ||
| + | Dim fs | ||
| + | Dim fname | ||
| + | Dim HasCert | ||
| + | Dim vStartNum | ||
| + | Dim vLength | ||
| + | Dim FileIndex | ||
| + | vStartNum = 1 | ||
| + | vSourcePath = " | ||
| + | vTargetPath = " | ||
| + | Set objfso = CreateObject(" | ||
| + | Set objFile = objfso.OpenTextFile(vSourcePath, | ||
| + | strtext = objFile.ReadAll | ||
| + | sSearchString1 = "< | ||
| + | sSearchString2 = "</ | ||
| + | objFile.Close | ||
| + | While InStr(vStartNum, | ||
| + | FileIndex = FileIndex + 1 | ||
| + | vStartNum = InStr(vStartNum, | ||
| + | vLength = InStr(vStartNum, | ||
| + | strNewText = Mid(strtext, | ||
| + | Set fname = objfso.CreateTextFile(vTargetPath & " | ||
| + | fname.WriteLine strNewText | ||
| + | fname.Close | ||
| + | vStartNum = InStr(vStartNum, | ||
| + | Wend | ||
| + | </ | ||
| + | |||
| + | ====VB Script Variables==== | ||
| + | |||
| + | ^ Name ^ Description | ||
| + | |ScriptCode|The actual VBScript code that is written in the tool| | ||
| + | |StepMessage| During a failure the reason for failure will be populated here| | ||
| + | |StepStatus| True or False| | ||