VBS modify the specified text to the specified content

Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd /c dir /s/b *.ini > list.txt",vbHide
Wscript.Sleep 1000
sFile = "list.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = objFSO.OpenTextFile(sFile,1)
Do While Not oFile.AtEndOfStream
strLine = oFile.ReadLine
If Len(strLine) > 0 Then
Set File = objFSO.OpenTextFile(strLine, 1)
aryLines = File.ReadAll
File.Close
aryLines = Replace(aryLines, "http://www.hao774.com/?90142-16009", "https://www.2345.com/?kywx")
Set File = objFSO.OpenTextFile(strLine, 2)
File.Write aryLines
File.Close
End If
Loop
oFile.Close
objFSO.DeleteFile sFile
Set objFSO = Nothing

Save as .vbs run. The .ini file put the same directory, the above code is to

http://www.hao774.com/?90142-16009 modified
https://www.2345.com/?kywx

Guess you like

Origin www.cnblogs.com/scrappy/p/11362009.html