Insert accents in a batch

akyrion -  
 Balafatch -
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. Copyright
     
    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!
    57
    1. Lamarovsky Kharchov Posted messages 86 Status Member 29
       
      That's well said!!
      You should have used WordPad instead of Notepad. There are no 36 solutions! Thank you!
      1
    2. knavenda
       
      Too strong, thank you!
      0
    3. borlanddelphiman
       
      The solution is useless... it does not answer the question at all...
      -1
    4. borlanddelphiman
       
      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
      -1
    5. nitneuc
       
      Not such a bad solution
      the file is encoded differently here is what is done
      -1
  2. LeNarvalo
     
    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.
    27
    1. Snej
       
      Great, it works!
      0
    2. old_desperado
       
      Indeed. It's working!!! Thank you.
      0
    3. Pierre
       
      It's the simplest! THANK YOU
      0
  3. Ti_Gaß
     
    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.
    22
  4. logon313 Posted messages 50 Status Member 9
     
    Hello!
    If you use Notepad ++ to create your batch programs, encode it in "OEM 850"

    --
    Advanced batcher
    5
    1. Balafatch
       
      Perfect, it's by far the simplest!!!!!!!!!!!!!!!!!!!!!!!!
      1
  5. Chrisix Posted messages 60 Status Member 60
     
    Well, okay... so the simplest (I think) is to use a DOS text editor like edit... (edit is supplied with Windows)
    2
    1. leoetlino Posted messages 99 Registration date   Status Member Last intervention   3
       
      You're right, it's simple!
      0
  6. Zep3k!GnO Posted messages 2049 Status Member 200
     
    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
  7. Nico
     
    For my part, I solved the problem in Notepad by changing the encoding to ANSI in the "Save as..." window.
    0
  8. akyrion
     
    Ahaha yeah sure I'm going to change my rep ^^
    I want to delete a shortcut installed by Adobe Reader ^^

    Anyway, the unicode characters ??
    -1
    1. Zep3k!GnO Posted messages 2049 Status Member 200
       
      Yes, yes, you can remove what Adobe added, no problem regarding the shortcut...


      Anyway, the unicode characters ??
      Here you go, sir :D

      -->http://www.collectionscanada.ca/6/19/s19-9235-f.html

      You'll see ..

      Zep3k!GnO
      -->hi i hi o we're not going to work :P
      0
  9. akyrion
     
    I used UltraEDIT with OEM display mode, added my accent and saved my batch

    Del ok :)
    -1
    1. Zep3k!GnO Posted messages 2049 Status Member 200
       
      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
      0
    2. Pierrot
       
      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...
      0
  10. Chrisix Posted messages 60 Status Member 60
     
    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"
    -3
    1. Pierrot
       
      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.
      0
  11. Xarkhan
     
    Thanks guys.

    This little tool (edit) saved my batch :)
    -3
  12. sibtcha
     
    How to use edit if the character we are looking for is "à"

    Thank you in advance
    -3
  13. leprofca
     
    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?
    -3
  14. Leahkim Posted messages 3219 Status Member 281
     
    EDIT worked perfectly for me!!
    -3
    1. chhoun_h Posted messages 1 Status Member
       
      The text editor Textpad works as well; just go to the tools menu and then "convert to dos" and then save the file.
      0