How to write a DOS script to extract all the file name in a directory

dos

I want to extract all the names and path of the file in a directory and its sub-directory into a text file. How can I do it by DOS scripting?

Thanks in advance.

Best Answer

dir * > t.txt

Or some other parameter to get your desired result.