批量编码转换包括gb2312,utf-8,unicode,支持拖动

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    '/*=========================================================================  
    ' * Intro       把要转换的文件拖到这个文件上,选择源编码与目标编码进行编码批量转换  
    ' * FileName    CodeChange.vbs  
    ' * Author      yongfa365  
    ' * Version     v1.0  
    ' * WEB         http://www.yongfa365.com  
    ' * Email       yongfa365[at]qq.com  
    ' * FirstWrite  http://www.yongfa365.com/Item/CodeChange.vbs.html  
    ' * LastModify  2007-10-04 14:29:44  
    ' *==========================================================================*/  
      
    Set objArgs = WScript.Arguments  
    If objArgs.Count>0 Then  
        CodeI = InputBox("您所拖动的文件的编码是:", "第一步,共两步", "gb2312")  
        CodeII = InputBox("您要将第一步的编码转换为:", "第二步,共两步", "utf-8")  
        If CodeI<>"" And CodeII<>"" Then  
            For I = 0 To objArgs.Count - 1  
                FileUrl = objArgs(I)  
                Call WriteToFile(FileUrl, ReadFile(FileUrl, CodeI), CodeII)  
            Next  
        Else  
            MsgBox "输入不合法,退出"  
        End If  
    Else  
        MsgBox "请将您要转换的“相同编码的文件”拖到这个文件上"&vbCrLf&"程序会根据您的输入转换这些编码", vbInformation, "柳永法温馨提示:"  
    End If  
      
    '-------------------------------------------------  
    '函数名称:ReadFile  
    '作用:利用AdoDb.Stream对象来读取各种格式的文本文件  
    '----------------------------------------------------  
      
    Function ReadFile(FileUrl, CharSet)  
        Dim Str  
        Set stm = CreateObject("Adodb.Stream")  
        stm.Type = 2  
        stm.mode = 3  
        stm.charset = CharSet  
        stm.Open  
        stm.loadfromfile FileUrl  
        Str = stm.readtext  
        stm.Close  
        Set stm = Nothing  
        ReadFile = Str  
    End Function  
      
    '-------------------------------------------------  
    '函数名称:WriteToFile  
    '作用:利用AdoDb.Stream对象来写入各种格式的文本文件  
    '参数:FileUrl-文件相对路径;Str-文件内容;CharSet-编码格式(utf-8,gb2312.....)  
    '----------------------------------------------------  
      
    Function WriteToFile (FileUrl, Str, CharSet)  
        Set stm = CreateObject("Adodb.Stream")  
        stm.Type = 2  
        stm.mode = 3  
        stm.charset = CharSet  
        stm.Open  
        stm.WriteText Str  
        stm.SaveToFile FileUrl, 2  
        stm.flush  
        stm.Close  
        Set stm = Nothing  
    End Function