problem with a .bat with accented letters
-
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 :)
-
@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:
-
Make sure the batch file is in an encoding the batch command interpreter can understand.
-
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 : 1252and 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.
-
-
Thanks :)
but I stopped.
Next to INS that I have on the bottom right, I have a different writing -

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.
-
@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?
-
@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 :)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login