Link to home
Start Free TrialLog in
Avatar of John Darby
John DarbyFlag for United States of America

asked on

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

Avatar of Qlemo
Qlemo
Flag of Germany image

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


Avatar of John Darby

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help.