ext/zlib-ng/win32/replace.vbs
raw| 1 | strInputFileName = Wscript.Arguments(0) |
| 2 | strOutputFileName = Wscript.Arguments(1) |
| 3 | strOldText = Wscript.Arguments(2) |
| 4 | strNewText = Wscript.Arguments(3) |
| 5 | |
| 6 | Set objFSO = CreateObject("Scripting.FileSystemObject") |
| 7 | Set objFile = objFSO.OpenTextFile(strInputFileName, 1) |
| 8 | |
| 9 | strText = objFile.ReadAll |
| 10 | objFile.Close |
| 11 | strNewText = Replace(strText, strOldText, strNewText) |
| 12 | |
| 13 | Set objFile = objFSO.OpenTextFile(strOutputFileName, 2, True) |
| 14 | objFile.Write strNewText |
| 15 | objFile.Close |