本帖最后由 czjt1234 于 2014-5-21 13:04 编辑
不会批处理处理编码,写了个vbs
- Dim strPath, Str, objFSO, objFile
- strPath = "."
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- For Each objFile In objFSO.GetFolder(strPath).Files
- If Lcase(Right(objFile.Name, 4)) = ".txt" Then
- With CreateObject("Adodb.Stream")
- .mode = 3
- .charset = "UTF-8"
- .Open()
- .loadfromfile objFile.Path
- Str = .readtext()
- If InStr(str, Mid(objFile.Name, 1, Len(objFile.Name) - 4)) > 0 Then Exit For
- End With
- With CreateObject("Adodb.Stream")
- .mode = 3
- .Open()
- .WriteText Mid(objFile.Name, 1, Len(objFile.Name) - 4) & vbCrLf & vbCrLf & Str
- .SaveToFile objFile.Path, 2
- End With
- End If
- Next
复制代码 本来想写一个测试原文件编码的,但是没成功
' * CodeChange.vbs BY: yongfa365 http://www.yongfa365.com 2007-10-04 *
' * U82GB.vbs BY: fastslz http://bbs.cn-dos.net 2007-12-03 * |