' Меняет в выделенных файлах "utf8" на "utf-8"
' параметры: %WL
Option Explicit
on error resume next
Dim FSO, FileList, List, F, filename, TextStream, Str
Set FSO = CreateObject("Scripting.FileSystemObject")
FileList = WScript.Arguments(0)
List = Split(FSO.OpenTextFile(FileList,,,-1).ReadAll, vbNewLine)
For Each F In List
If F <> "" Then
set filename = FSO.Getfile(F) ' Имя файла
Set TextStream = FSO.OpenTextFile(filename, 1, False, -2)
Str = TextStream.ReadAll
TextStream.Close
Set TextStream = FSO.OpenTextFile(filename, 2, False, -2)
Str = replace(Str, "charset=utf8", "charset=utf-8")
TextStream.Write Str
TextStream.Close
End If
Next |