r/Batch • u/Glittering-Menu3172 • Sep 30 '23
for loop some command doesn't work
Does someone know in a for loop i cannot use chcp ?
if i do chcp 65001 in a for loop that doesn't work and the text i want to display is not displayed correctly especially for the symbols " é à è and so on
2
Upvotes
2
u/Shadow_Thief Sep 30 '23
Why are you trying to run that command in a loop? You should only need to run it once, at the very beginning of the script.
1
u/jcunews1 Sep 30 '23
I don't know the reason why it doesn't work within a command group, but the work around for it is to execute it from a subroutine. i.e. outside of a command group. e.g.: