Tested on Windows 7 only, may not work on Windows Vista.
Apparently chcp
doesn't affect dir
directly.
Parse the output of dir
and print it via echo
:
chcp 65001
>list_of_files.txt (for /f "delims=" %%a in ('dir /B /O:N') do echo %%a)
Note: the output file won't have UTF-8 Byte Order Mark.