Use Special Characters in Batch Files

10,820

6

4

This tutorial will show you how to use special characters in batch files
For example in a batch file this won't work
Echo á

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Open Cmd

First open cmd.exe
Paste in
for %X in (a-acc:á e-acc:é i-acc:í o-acc:ó u-acc:ú u:uml:ü n-til:ñ) do (@echo:%X) >> international.txt
That will give you áéóúñ in a format they can be viewed from a batch file just copy the symbol out of international.txt which should be located in C:\Users\Your-username-here

Step 2: The End

You can replace the letters áéóúñ with symbols you want just change then in the line you pasted into cmd.

Please also look at my other instructables here
https://www.instructables.com/member/Batchcc?show=INSTRUCTABLES
Or more of my batch file tutorials here
https://www.instructables.com/id/Full-screen-batch-matrix/

And get windows Xp FREE LEGALY from Microsoft here
https://www.instructables.com/id/Download-Windows-Xp-legally-FREE-from-microsoft/

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    4 Discussions

    0
    None
    DanielS1154

    Tip 10 months ago

    Codes List:
    E.g: CHCP 65001
    437 - United States850Multilingual (Latin I)
    852 - Slavic (Latin II)
    855 - Cyrillic (Russian)
    857 - Turkish
    860 - Portuguese
    861 - Icelandic
    863 - Canadian-French
    865 - Nordic
    866 - Russian
    869 - Modern Greek
    1252 - West European Latin
    65000 - UTF-7 *
    65001 - UTF-8 *

    :: Code batch below
    @echo off & color 0A
    chcp 65001 >nul
    title Specials Chars
    :begin
    echo áéíóúý
    echo ãõ
    echo äëïöüÿ
    echo ç
    pause>nul & exit

    2018-12-07_11-11-53.png
    0
    None
    Bala M

    2 years ago

    Hello Batchcc,

    I have tried the above command for some other special characters such as ° â ç µ etc...

    But it doesn't help me..can you please suggest me to resolve the error? I have attached the error screenshot.Thank you!!

    Capture.PNG
    1 reply
    0
    None
    BatchccBala M

    Reply 2 years ago

    Is cmd creating the file?the characters that kt create in the text file may look like spaces; however, when added to a batch file they should work. If this doesn't help can you tell me a little more about the problem? -Batchcc