Tech Support > Operating Systems > MS-DOS > Enable Unicode output from inside a DOS batch script ? "cmd /U" equivalent ?
Enable Unicode output from inside a DOS batch script ? "cmd /U" equivalent ?
Posted by Werner Sammer on March 8th, 2007


Ok, when I start a new command prompt with the parameter flag /U then all
output is done in Unicode. That means when I enter "dir" then e.g. german Umlaute
in filenames are recognized correctly.

But what is the equivalent for the /U switch in DOS batch files ?

How can I turn on Unicode output from within batch files ?

Do I really have to prepend EVERY single command in a batch file with:

cmd /k /U "....."

e.g.

cmd /k /U "dir >myfile.txt"

to force Unicode output ?

I could imagine that there is a global command on the top of a batch file like

enableunicode

that has the same effect. I am working under WinXP. Maybe there is a speical environment
setting for this OS.

Werner