Executing a batch file with Unicode

I have the following batch to run Internet Explorer using RUNAS. I want to use Unicode characters to paint a box around some text echoed to the screen. I have tried Unicode, Unicode Big-Endian and UTF-8, but the output is hard to read. How do I set the displayed character set to be Unicode and not forced as ASCII, which looks terrible.


cmd /u /k
@echo off
echo     ****unicode characters here****
echo      DOMAIN\PWLAB password pattern is MmmYYYY (eg. May2009)
echo     ****unicode characters here****
runas /noprofile /env /user:domain\pwlab "C:\Program Files\Internet Explorer\iexplore.exe http://website/topologybuilderweb/MainForm.aspx"
pause

Open in new window

LVL 1
John DarbyPMAsked:
Who is Participating?
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
You can't use Unicode characters. All symbols have to be in the same codepage, and that codepage is to be set by chcp.

0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Common method is to change the code page to a 1252 in DOS, and store the batch file in ASCII. To switch to the Windows Codepage, use
chcp 1252 >nul


0
 
John DarbyPMAuthor Commented:
Thanks Qlemo. However, when I insert the suggested string, the screen output remains the ASCII view of the Unicode characters. Any idea what I am missing?
0
 
John DarbyPMAuthor Commented:
Thanks for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.