Set WshShell=CreateObject(“Wscript.Shell”)
WshShell.Run “cmd /c dir /s/b *.htm > list.htm”,vbHide
Wscript.Sleep 1000
Set WshShell=CreateObject(“Wscript.Shell”)
WshShell.Run “cmd /c dir /s/b *.htm > list.htm”,vbHide
Wscript.Sleep 1000
sFile=”list.htm”
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, “需要替换的内容”, “替换后的内容”)
Set File=objFSO.OpenTextFile(strLine, 2)
File.Write aryLines
File.Close
End If
Loop
oFile.Close
objFSO.DeleteFile sFile
Set objFSO=Nothing
© 版权声明
文章版权归作者所有,未经允许请勿转载。