I have a bat file that reads the lines a file, and then tries to create files or folders, depending on the given argument.
The problem is that when it gets to chars as ăâțîș, it does not work.
This is my code:
IF "%1"=="" GOTO Final
IF "%1"=="file" GOTO File
IF "%1"=="folder" GOTO Folder
:File
for /f %%i in (files.txt) do echo. > %%i.rtf
GOTO Final
:Folder
for /f "tokens=*" %%a in (folders.txt) do (
mkdir "%%a"
)
GOTO Final
:Final
What I've tried so far using this link: Manage paths with accented characters
How can i solve this?
Put CHCP XXX into the batch where XXX is a codepage that matches encoding of your text files (files.txt and folders.txt). Note that you can use CHCP 65001 which is equivalent of UTF-8 and should handle most of diactrics without problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With