• Login
Community
  • Login

problem with a .bat with accented letters

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 3 Posters 149 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    Furio Sassi
    last edited by Apr 6, 2025, 7:46 AM

    Hi :)

    I need to create a .bat that inside the path there is an accented letter. I read that Notepad++ can somehow convert the text making it work, can you tell me how to do it?

    The bat contains only this line:

    for %%A in (%*) do start “” “D:\DVD - 03\Musica\Test qualità\Spek\spek.exe” %%A

    thanks :)

    C 1 Reply Last reply Apr 6, 2025, 5:25 PM Reply Quote 0
    • C
      Coises @Furio Sassi
      last edited by Apr 6, 2025, 5:25 PM

      @Furio-Sassi said in problem with a .bat with accented letters:

      I need to create a .bat that inside the path there is an accented letter. I read that Notepad++ can somehow convert the text making it work, can you tell me how to do it?

      The bat contains only this line:

      for %%A in (%*) do start “” “D:\DVD - 03\Musica\Test qualità\Spek\spek.exe” %%A

      There are a couple of solutions to this. In case you or others reading this do not know: the problem is that the batch command interpreter in Windows uses a different character encoding than what Windows uses for most files.

      The solutions are some combination of:

      1. Make sure the batch file is in an encoding the batch command interpreter can understand.

      2. If you’re not using the default encoding for the batch interpreter, tell the interpreter which encoding you are using.

      So, first, open the file in Notepad++ and look at the status bar at the bottom near the right. At the far right, you’ll see INS (or, unlikely, OVR); to the left of that, you’ll see the file encoding.

      Probably that will be either ANSI or UTF-8.


      If it is UTF-8, add this line to the beginning of the file:

      chcp 65001
      

      If it is ANSI:

      Click the ? at the right of the menu bar and select Debug Info…; find the line:

      Current ANSI codepage : 1252
      

      and note the number. (It’s probably 1252 if your installation is English or Western European; otherwise it will be something else.)

      Add the line:

      chcp 1252
      

      (substituting whatever number you found) to the beginning of the file.


      If it is UTF- something BOM, or if it is anything else but ANSI or UTF-8, first right-click that indicator and select Convert to UTF-8. Then proceed as above for UTF-8.


      With some convoluted processing it is possible to use Notepad++ to convert the file to the native DOS encoding instead of doing it this way, but adding a chcp line is simpler.

      F 1 Reply Last reply Apr 6, 2025, 9:33 PM Reply Quote 4
      • F
        Furio Sassi @Coises
        last edited by Apr 6, 2025, 9:33 PM

        @Coises

        Thanks :)
        but I stopped.
        Next to INS that I have on the bottom right, I have a different writing

        alt text

        P C 2 Replies Last reply Apr 6, 2025, 10:11 PM Reply Quote 0
        • P
          PeterJones @Furio Sassi
          last edited by PeterJones Apr 6, 2025, 10:12 PM Apr 6, 2025, 10:11 PM

          @Furio-Sassi ,

          3e2199a3-cf4d-458c-99fc-db718a71948e-image.png

          Please just paste the actual image from your clipboard, rather than uploading to another website and then trying (and failing) to link to that image; that also prevents us from having to see the ads of the external image-hosting service. You can literally take your screenshot, and paste that screenshot into the Forum without ever creating a file.

          1 Reply Last reply Reply Quote 0
          • C
            Coises @Furio Sassi
            last edited by Apr 6, 2025, 10:42 PM

            @Furio-Sassi said in problem with a .bat with accented letters:

            Next to INS that I have on the bottom right, I have a different writing

            I wrote:

            if it is anything else but ANSI or UTF-8, first right-click that indicator and select Convert to UTF-8. Then proceed as above for UTF-8.

            Did you try that?

            F 1 Reply Last reply Apr 7, 2025, 6:23 AM Reply Quote 0
            • F
              Furio Sassi @Coises
              last edited by Apr 7, 2025, 6:23 AM

              @Coises
              sorry if I made a mistake in putting the photo on the site.

              I converted the text as you told me everything and now it works perfectly, thank you, you were very kind, bye :)

              1 Reply Last reply Reply Quote 1
              2 out of 6
              • First post
                2/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors