How to copy all file names in a directory to a text file in Windows

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

Step 02:
Navigate to the directory which has the files and type the following command –

DIR /B /O:N > filename.txt

This will save all the filenames in the current directory to a text file. The text file will be saved in the same directory.

Step 03:
To save file names from any sub-directories in the current folder, just add /S like –

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

That’s all!

Author: Ryan Kessen

Computer Repair, Freelancer, Blogger, Reviewer and all around nice guy!

Leave a Reply

Your email address will not be published. Required fields are marked *