How to copy all files names from a folder in Windows?

Microsoft Windows Command:
Example:

dir /B > filelist.txt


If we go to d:\ant\bin\Target\layouts, we can find a text file with name "filelist.txt" which contains all the file names of the files in that path.