新建一个 conv.vbs 文件 把下面的代码复制进去
'用法:将要更改编码的所有文件放到同一个文件夹中,将文件夹拖到该vbs上,输入要转换成的字符编码
Dim fso,fd,fl,f,fdpath,charset
On Error Resume Next
If WScript.Arguments.Length>=1 Then
fdpath = WScript.Arguments(0)
Else
fdpath = InputBox("E:\xunlian\新增加的训练集","第一个参数")
If fdpath = "" Then WScript.Quit
End If
If WScript.Arguments.Length>=2 Then
charset = WScript.Arguments(1)
Else
charset = InputBox("UTF-8","第二个参数")
if charset = "" then WScript.Quit
if UCase(charset) = "ANSI" then charset = "GB2312"
End If
Set fso = CreateObject("scripting.filesystemobject")
Set fd = fso.GetFolder(fdpath)
Set fl=fd.Files
For each f in fl
convertct f.Path,charset
Next
MsgBox "