A
A
Alexander2020-10-30 14:05:07
Computer networks
Alexander, 2020-10-30 14:05:07

msg command not sending cyrillic characters?

Good afternoon!
There is a *.bat-file that sends a message to one of the computers inside the locale.
If you specify Russian characters in the text of the message, the recipient will see unreadable characters.

Is it possible to somehow send Russian characters with a command msg?
The command is:
msg * /server:COMPMANAGER /v /w "text with bastard characters"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akina, 2020-10-30
@Dem0lisher

Encoding mismatch. For example, the batch file text is in 866 encoding, and the current (default) console encoding is 1251. This is where unreadable characters are displayed.
At the beginning of the batch file, insert the command
CHCP {кодовая страница}
The batch file itself - must also be in the same encoding that is specified in this command.
Then Cyrillic will be correctly converted.
You can get a guaranteed correct batch file like this:

  1. Opening a console window
  2. We set some correct code page (for example, 1251) with the commandCHCP 1251
  3. We give a commandCOPY CON filename.BAT
  4. We type with our hands or copy into the console the desired code with Cyrillic. But in the very first line we type the command to install the same encodingCHCP 1251
  5. We finish with a combination of Ctrl-Z - the file is saved

The file obtained in this way is created in the same encoding as the console will use at the time of execution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question