I am making a batch file that uses these characters:
˧ ˥ ˪ ˫
It is not working, it just terminates itself.
I have seen people use characters like this:
Å
It isnt the character but it turns into a character, can someone give me a list of these, shows the type of letter above and what it turns into?
If you want to write console batch files that use those characters, you need an editor that will save the batch file using the console's code page. To check what that is, type:
C:\>chcp
Active code page: 437
This is the result for my US Windows system.
A good editor is Notepad++. Set that encoding in the editor (Encoding, Character sets, Western European, OEM-US) and copy the following characters into it:
@echo off
echo ╔═╦═╗ ┌─┬─┐ ╓─╥─╖ ╒═╤═╕
echo ║ ║ ║ │ │ │ ║ ║ ║ │ │ │
echo ╠═╬═╣ ├─┼─┤ ╟─╫─╢ ╞═╪═╡
echo ║ ║ ║ │ │ │ ║ ║ ║ │ │ │
echo ╚═╩═╝ └─┴─┘ ╙─╨─╜ ╘═╧═╛
Save the file as test.bat
and run it from the console:
C:\>test
╔═╦═╗ ┌─┬─┐ ╓─╥─╖ ╒═╤═╕
║ ║ ║ │ │ │ ║ ║ ║ │ │ │
╠═╬═╣ ├─┼─┤ ╟─╫─╢ ╞═╪═╡
║ ║ ║ │ │ │ ║ ║ ║ │ │ │
╚═╩═╝ └─┴─┘ ╙─╨─╜ ╘═╧═╛
When you open the file again in Notepad++, it is possible that you will see something like:
@echo off
echo ÉÍËÍ» ÚÄÂÄ¿ ÖÄÒÄ· ÕÍÑ͸
echo º º º ³ ³ ³ º º º ³ ³ ³
echo ÌÍÎ͹ ÃÄÅÄ´ ÇÄ×Ķ ÆÍØ͵
echo º º º ³ ³ ³ º º º ³ ³ ³
echo ÈÍÊͼ ÀÄÁÄÙ ÓÄÐĽ ÔÍÏ;
Since there is no indication in the file what code page the characters in it represent, Notepad++ may choose the so-called ANSI
code page. On US Windows that is Windows-1252
. Just select the OEM-US
encoding again to display it properly.
The characters you can use depend on the console codepage that is set. You can see it with chcp
. On many systems it's 850 or 437. You can then look up the characters in that code page or find one that supports the characters you need and use chcp
in your batch file to set it early on.
Note though that this is a setting for the process, so if someone needs to continue working with the console window afterwards it might not be nice to change their drapes to another colour. Also code page 65001 is UTF-8, but has a set of problems and drawbacks that make it rather tricky to use.
Note also that Notepad is not a useful text editor for writing batch files that need more than ASCII, because the legacy encoding in the non-console part of Windows is a different one. This might be what you mean that Å turns into another character.
You just need this equivalences file that works in any text editor, including the standard Windows Notepad:
Notepad: ┌┬┐ ├┼┤ └┴┘ ─ │
cmd.exe: Ú¿ ÃÅ´ ÀÁÙ Ä ³
Notepad: ╔╦╗ ╠╬╣ ╚╩╝ ═ ║
cmd.exe: ÉË» Ìι Èʼ Í º
Copy this table into a text file, that you must save as Unicode encoding. Then, when you want to insert a character in your Batch file, just choose the one below the graphic char you want to show.
Note: These characters are correct for code pages 850 or 437.
This table was copied from this answer.