Simple question:
On Windows 10, I found a quick and dirty solution to save the names of all the files in a folder by just simply:
- Creating a text file
- Type and save
dir > 1.txt
within it - Rename the .txt file to .bat
- Run it. Done.
But, the text file this creates is in ANSI encoding, and thus won't show certain characters... Is there a simple script I can add to the bat file before running it to make the generated texts encoded as UTF-8?
chcp 65001
to change code page to UTF-8 – Suggestibledir /?
, press the[ENTER]
key, and take a look at its options. As a minimum, for just the file names, you should use the/B
option, and the/A
option with-D
, (which will exclude directories). There is also no need to perform all of your bulletted items, just open a Command Prompt window, and type, for exampleDir /B /A:-D "C:\Users\ShoulderMonster\Desktop" 1> "C:\Users\ShoulderMonster\Documents\1.txt"
– Malignity