Solved

Executing a batch file with Unicode

Posted on 2009-05-04
4
2,217 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
  • 2
  • 2
4 Comments
 
LVL 68

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 68

Accepted Solution

by:
Qlemo earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

by Nathan Brom/Bromy2004 Introduction There are numerous websites out there for any different type of program you can imagine.  Of those, you'll need to decide which ones are legitimate and aren't trying to steal your money or infect your comput…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

948 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now