How to export a directory list from command prompt?

dir > textfile.txt

will export (pipe) it to a plain text file. You can do whatever you want with it afterwards.

If you wish to append, use two >>'s

dir >> textfile.txt

If you wish the file to be in another directory, just use

dir > c:\temp\textfile.txt

Without timestamp

dir/b

for example ?


Easy!

dir > list.txt