Home > Software design >  List all the file names from a folder and write out to a txt file keeping the special characters usi
List all the file names from a folder and write out to a txt file keeping the special characters usi

Time:07-28

I need to write out file names from a folder (subfolder) to txt but i also need to keep the special characters like for example: öüóőúéáű (hungarian) as well. I 've tried this:

dir /s /b > filenames.txt

but it is not work this time. Can you help me? Thank you!

CodePudding user response:

This batch can did the trick using the code page chcp 65001 :

@echo off
chcp 65001>nul
dir /s /b>filenames.txt
start "" /MAX filenames.txt
  • Related