Copy all Filenames in a Directory to a Text File

Posted by Latest Computer Tips and Tricks On 0 comments

Copy all Filenames in a Directory to a Text File

Here is a way to copy all file names present in a particular directory to a text file.

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

2. 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.

3. To save file names from any sub-directories in the current folder, just add /S like -
DIR /B /O:N /S > filename.txt

0 comments:

Post a Comment