▽1
●
Mook ●500ポイント ベストアンサー |
こういう事でしょうか。
Option Explicit Const sText = "<meta http-equiv=""Content-Type"" content=""text/html;>" Const rText = "<meta http-equiv=""Content-Type"" content=""text/html"" name=""robots"" content=""noindex,nofollow""> " Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Dim htmlFile Dim htmlText Dim folder For Each folder In fso.GetFile(WScript.ScriptFullName).ParentFolder.SubFolders For Each htmlFile In folder.Files If fso.GetExtensionName( htmlFile.Name ) = "html" Then htmlText = fso.OpenTextFile( htmlFile.Path ).ReadAll() fso.CreateTextFile(htmlFile.Path,True).Write Replace(htmlText,sText,rText) End If Next Next