?
Solved

Executing a batch file with Unicode

Posted on 2009-05-04
4
Medium Priority
?
2,284 Views
Last Modified: 2012-05-06
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
Comment
Question by:johndarby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Qlemo
ID: 24297730
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
 
LVL 1

Author Comment

by:johndarby
ID: 24298196
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
 
LVL 70

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 24299929
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
 
LVL 1

Author Closing Comment

by:johndarby
ID: 31577661
Thanks for your help.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Log files are useful in diagnosing and repairing problems.  This is a list of common log files and their standard locations that I've compiled.   While this is not exhaustive, it is a pretty good list that I've found to be useful.  I may update it f…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question