Insert accents in a batch

Bonjour, I would like to use the following command in a *.bat but the accents don’t work… how can I do that?

C:\Documents and Settings\All Users\Start Menu\Programs\Startup\Quick Launch of Adobe Reader.lnk

14 answers

  1. Hello everyone,

    I recently faced the same problem, and I found a much simpler solution:

    Open your bat file with WordPad, and if you can't find it, type wordpad.exe in the command prompt.

    And save your file as an MS-DOS text document.

    Voila !!! All your special characters have been converted!
    1. That's well said!!
      You should have used WordPad instead of Notepad. There are no 36 solutions! Thank you!
    2. Too strong, thank you!
    3. The solution is useless... it does not answer the question at all...
    4. A description of the replacement of special characters would have been really better. But well, human beings want to arrive at a solution without truly understanding the underlying issues :P
    5. Not such a bad solution
      the file is encoded differently here is what is done
  2. I found a more logical solution than using Wordpad while crossing my fingers hoping it would work... Use Notepad++, click on Encoding in the menu bar, then on Character encoding > Arabic > OEM 720, and there you go, you can enter your accented letters and see them appear correctly.
    1. Great, it works!
    2. Indeed. It's working!!! Thank you.
    3. It's the simplest! THANK YOU
  3. Mmmh, here’s how I proceed ; - ) :

    https://openclassrooms.com/forum/sujet/gravez-vos-fichiers-en-invite-23139#r2079981

    I know the topic may not seem related, but I explain it in one of the messages in the thread.

    P.S. Sorry to the moderators if you think I'm bumping an old thread.

    Here’s an example of using accents:

    @echo off
    echo €a uses accented characters in Batch ;).
    set /p test=Please enter accented characters:
    echo %test%
    %homedrive%
    cd C:\Documents and Settings\Owner\Desktop
    echo If the Owner directory does not exist, ignore the error message.
    cd
    pause
    cls
    echo Deleting the directory …†…. If it is not present, ignore the error message.
    rd …†…

    Place this .bat file on the desktop and execute it. There you go!

    Finally, look at my link, I typed a complete table of character conversions. In about a day, I will also post a .doc (Word) sheet that contains all the characters that "should not be used in a batch". I say this in quotes. Because some people say it’s impossible and others like me say yes :D.
    One last thing, I'm just passing through this site. I noticed this thread on Google and couldn't help but reply. I also want to let you know that I will come back to check the replies to this thread.

    With that, see you next time.
    1. Hello!
      If you use Notepad ++ to create your batch programs, encode it in "OEM 850"

      --
      Advanced batcher
      1. Perfect, it's by far the simplest!!!!!!!!!!!!!!!!!!!!!!!!
    2. Well, okay... so the simplest (I think) is to use a DOS text editor like edit... (edit is supplied with Windows)
      1. You're right, it's simple!
    3. well change your directory shortcut.... :D
      Otherwise, maybe you should check with unicode characters to see if that works...

      Zep3k!GnO
      -->hi i hi o we're not going to work :P
      1. For my part, I solved the problem in Notepad by changing the encoding to ANSI in the "Save as..." window.
        1. Ahaha yeah sure I'm going to change my rep ^^
          I want to delete a shortcut installed by Adobe Reader ^^

          Anyway, the unicode characters ??
        2. I used UltraEDIT with OEM display mode, added my accent and saved my batch

          Del ok :)
          1. I used UltraEDIT

            UltraEdit, let me tell you, this text editor is AMAZING, it's awesome!

            I use it a lot... :D

            Zep3k!GnO
            --> hi i hi o we're not going to work :P
          2. For your information, I also had a problem with accents in a batch file and came across your discussion which made me think and remember the creation of batch files under Windows 3.1 (it doesn’t make us any younger!!!!!).

            There is an editor provided with DOS by simply typing the command EDIT which allowed me to solve my problem without going through UltraEDIT. It’s true that it’s not the latest thing in terms of editors, but it works very well and the accents too...
        3. Hello... to solve the original problem, it seems better to use the short names from MS-DOS

          like "c:\docume~1\user\mesdoc~1"

          instead of "c:\documents and settings\user\my documents"
          1. I completely agree with you although your answer doesn't provide any solutions to my problem.

            No worries about going to c:\progra~1\micros~1 etc., etc.

            However, for the Models directory (which is only 7 characters long), the batch edited with a notepad returns a "weird" character for the accented character. When using the DOS editor (EDIT), the character returned is the correct one.

            The end.

            P.
        4. How to use edit if the character we are looking for is "à"

          Thank you in advance
          1. Hello,

            I'm having the same accent issue in my batch files. I've tried your suggestions using EDIT... it converted my é into a u with an acute accent.... so my problem remains unsolved... solution?
            1. EDIT worked perfectly for me!!
              1. The text editor Textpad works as well; just go to the tools menu and then "convert to dos" and then save the file.