• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2307
  • Last Modified:

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

0
John Darby
Asked:
John Darby
  • 2
  • 2
1 Solution
 
QlemoC++ DeveloperCommented:
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
 
QlemoC++ DeveloperCommented:
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
 
John DarbyPMAuthor Commented:
Thanks for your help.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now