I have a strange issue while trying to change the codepage in a .bat file.
When I execute the following .bat file in Windows 7 it executes fine.
The codepage gets changed and program.exe
get executed.
The batch file:
chcp 65001
"D:\program.exe" /opt ÄiÜ
pause
However when I start the .bat file from Windows Vista the codepage gets changed and after that the batch file is exited.
So program.exe
never gets executed.
However when I run the two commands manually from the commandline it does work.
Any idea how to get this working under Windows Vista from .bat file?
It's new to me that this works with Win7, in Vista and XP it's normal that batch files aren't work if the codepage is changed to 65001.
But you can use a workaraound
(
chcp 65001
cmd /c type myFile.txt
chcp 850
)
echo the batch is still alive
This works, as the complete block is cached while the codepage is changed.
In your case (with german umlauts) you could better use the codepage 1252
chcp 1252
echo ÄÖÜß
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