Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

.bat file with Unicode characters

Featured Replies

I found this example and wrote something according to my needs. However, adding Unicode characters does not seem to work. Anybody know how to do it successfully?

Thanks

I don't understand the question.

It should actually have a .cmd extension, and it is so short one can post it in a codebox without problems:

@echo off
cls

TITLE:

echo 1) Mozilla Firefox
echo 2) Internet Explorer 8
echo 3) Media Player Classic
echo 4) EXIT

:a
set /p ans=Enter a number:

if '%ans%'== '1' GOTO one
if '%ans%'== '2' GOTO two
if '%ans%'== '3' GOTO three
if '%ans%'== '4' GOTO four


GOTO a

:one
cd "C:\Program Files\Mozilla Firefox"
start firefox.exe

GOTO a

:two

cd "C:\Program Files\Internet Explorer"
start iexplore.exe

GOTO a

:three
cd "C:\Program Files\K-Lite Codec Pack\Media Player Classic"
start mplayerc.exe

GOTO a

:four
exit

Can you try beetter explaining the problem (apart the fact that "TITLE:" is hardly a batch command)?

jaclaz

  • Author

The thing is I want to include Cyrillic characters for explanations, which prompts to save it as Unicode. When started in Unicode, it won't work, and if I ignore the prompt and save it in ASCII with Cyrillic characters, they're shown as question marks. So, you're saying that if I save it in Unicode as a .cmd file, it will work?

To answer my own question, it doesn't.

Edited by Sp0iLedBrAt

The thing is I want to include Cyrillic characters for explanations, which prompts to save it as Unicode. When started in Unicode, it won't work, and if I ignore the prompt and save it in ASCII with Cyrillic characters, they're shown as question marks. So, you're saying that if I save it in Unicode as a .cmd file, it will work?

No, I am saying that I did not understand your question, and that the file you posted contains no UNICODE characters, nor Cyrillic ones.

Can you post an example (a short Cyrillic name/word)?

Read this in the meantime:

http://www.chem.msu.su/soft/convert/readme.txt

Get the file:

http://www.chem.msu.su/soft/convert/

and play with it a bit.

are you using (CP866) or (CP1251)?

Open a command prompt, type in it EDIT [ENTER]

and use the "DOS" editor to create/modify the batch.

jaclaz

  • Author

@echo off
cls

ОДБЕРИ ПРОГРАМА ИЛИ ЗАВРШИ:

echo 1) Mozilla Firefox
echo 2) Internet Explorer 8
echo 3) Media Player Classic
echo 4) ЗАВРШИ

:a
set /p ans=Enter a number:

if '%ans%'== '1' GOTO one
if '%ans%'== '2' GOTO two
if '%ans%'== '3' GOTO three
if '%ans%'== '4' GOTO four


GOTO a

:one
cd "C:\Program Files\Mozilla Firefox"
start firefox.exe

GOTO a

:two

cd "C:\Program Files\Internet Explorer"
start iexplore.exe

GOTO a

:three
cd "C:\Program Files\K-Lite Codec Pack\Media Player Classic"
start mplayerc.exe

GOTO a

:four
exit

This, for example. BTW, I use Notepad to edit batch files, so I'm not really sure about which set I'm using.

Edited by Sp0iLedBrAt

You won't like the answer.

You need:

  • to have LucidaConsole (or another TTF font, NOT the raster one)
  • to change page to 1251
  • possibly start CMD.EXE with the /U parameter :unsure:

You need to have SEPARATE batch file and Cyrillic text.

Example copy and paste this in a Notepad or Wordpad and save as Unicode with name "choices.txt":

1 ОДБЕРИ

2 ПРОГРАМА

3 ИЛИ

4 ЗАВРШИ

Copy and paste the following in a Notepad or Wordpad and save as "plain" text with name "test.cmd"

@ECHO OFF
chcp 1251>nul
more choices.txt
for /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "1"') DO ECHO %%B
for /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "2"') DO ECHO %%B
for /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "3"') DO ECHO %%B
for /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "4"') DO ECHO %%B
chcp 437>nul

Open a command prompt, make sure that you are using Lucida Console.

Type in it:

MORE choices.txt

[ENTER]

Now run test.cmd:

TEST

[ENTER]

jaclaz

  • 11 years later...

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.