The batch file fails, simply because there's a missing call to
Code Page before using Spanish (or non-English) characters. Like ó.
Before W10 1903, Notepad defaulted to saving text in
ANSI encoding format. Later Notepad editions switched to
UTF-8. If you're writing UTF-8 files, then you need to first call "chcp 65001" in any CMD scripts that reference Spanish characters.
Correct batch file (saved in UTF-8 encoding):
Code:
chcp 65001 > nul
dir /b "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada"
dir /b "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada\000 Móvil\Vídeos"
move /y "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada\000 Móvil\Vídeos\*.*" "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada\Videos"
Running the same script, first
without chcp and then after
with chcp:
Let's re-confirm our experiment, by switching to ANSI format.
Same batch file (except saved in ANSI). ANSI requires using "chcp 1252".
Code:
chcp 1252 > nul
dir /b "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada"
dir /b "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada\000 Móvil\Vídeos"
move /y "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada\000 Móvil\Vídeos\*.*" "C:\Users\GARLIN\Downloads\DIEGO\Bandeja de entrada\Videos"
PowerShell probably handles this pathname encoding better (especially if using -LiteralPath) than the DOS-era copy and move commands.
I'm sure
@LesFerch has a better explanation for how the wrong Code Page breaks all sorts of code.