There is a much easier way to get your directory listing into a text file:
Open the command line "cd" to the directory you want type "dir >> "C:Your_Text_File.txt"
Thats it, it will create your text file with the directory listing. Better yet, you can use ">>" with any other commands, all it does is direct the output to a text file.