1 . Open up your command prompt by typing cmd in the run dialog box and hitting Enter.

Got to know this last week! This works great if you want to save all the filenames in a directory to a text file. . Open up your command prompt by typingin the run dialog box and hitting Enter.

2

DIR /B /O:N > filename.txt

3

DIR /B /O:N /S > filename.txt

. Navigate to the directory which has the files and type the following command -This will save all the filenames in the current directory to a text file. The text file will be saved in the same directory.. To save file names from any sub-directories in the current folder, just add /S like -That's all!