I\'m trying to use the tree command in a windows commandline to generate a text file listing the contents of a directory but when I pipe the output the unicode characters get st
This will save the results as ASCII (American Standard Code for Information Interchange) on your desktop, ASCII\ANSI doesn't recognize every international or extended character:
tree /f > ascii.txt
This will convert your ASCII text to Unicode (/c must precede actual command):
cmd /u /c type ascii.txt > unicode.txt
So why not just think of the ascii file as a temporary file and delete it?
del ascii.txt
If you must put all in one line you could use:
tree /f > ascii.txt & cmd.exe /u /c type ascii.txt > unicode.txt & del ascii.txt