If you want Unicode to be supported in a batch file, CHCP on a separate line simply interrupts the batch file. I suggest putting CHCP on every line of the batch file that needs unicode, as shown below.
chcp 65001 > nul && <real command here>
Example. In my case, I wanted to have a good HALL of my log files during debugging, but the content for Latin-1 characters was messed up. So here is my batch file that wraps the real tail implementation from the Windows resource set.
@C:\WINDOWS\system32\chcp.com 65001 >nul && tail.exe -f %1
In addition, for output to the console, you need to install a font of the true type, that is, the Lucidia console.
And apparently, for the output to the file, the command line should run as Unicode, so you can run your batch script as follows
cmd /u /c <batch file command here>
Disclaimer: tested on Windows XP sp3 using the Windows Resource Kit.
Jennifer zouak
source share