The output is absolutely correct because it is:
│ ├───DbTransactions
│ │ ├───2018-08-07
│ │ ├───2018-08-08
│ │ ├───2018-08-09
│ │ ├───2018-08-10
│ │ ├───2018-08-11
│ │ ├───2018-08-16
│ │ ├───2018-08-17
│ │ ├───2018-08-18
│ │ ├───2018-08-21
│ │ ├───2018-08-22
│ │ ├───2018-08-23
│ │ ├───2018-08-24
│ │ ├───2018-08-25
│ │ ├───2018-08-28
│ │ ├───2018-08-29
What you don't know is how characters are encoded which every programmer should really know.
In console environment the character encoding is usually an OEM character encoding which means there is one byte used per character. So the number of characters is limited to 2^8 = 256 characters.
Open a command prompt window and run the command chcp. This command outputs the code page being set by default for console applications depending on the country configured for the used user account in Windows Region and Language settings. For example the code page OEM 850 is used by default in Western European countries and similar code page OEM 437 in North American countries.
But the code page used in GUI applications like Windows Notepad for text files with a character encoding using just one byte per character depending also on country setting is for example Windows-1252 in North American and Western European countries.
Look on the character sets of the referenced code pages:
- Byte with decimal value 179 is character
³ in Windows-1252 and character │ in OEM 437/850.
- Byte with decimal value 195 is character
à in Windows-1252 and character ├ in OEM 437/850.
- Byte with decimal value 196 is character
Ä in Windows-1252 and character ─ in OEM 437/850.
So the output is not weird. You just view the text file with using a different code page as used for creating the text file.
The command chcp can be used in a console window with an argument to change code page. But the usage of chcp 1252 at top of the batch file before running tree t:\directory > RESULTS\%thecomputer%.log is of no help because Windows-1252 has no box-drawing characters in its character set. That is the reason why command tree has the parameter /A as output in help on running tree /? to use ASCII characters instead of characters from extended character set of active code page.
/aargument withtreeso that it uses ASCII instead of extended characters. Viewtree /?for help.