Copy all Filenames in a Directory to a Text File

http://txpress.blogspot.com/2008/11/copy-all-filenames-in-directory-to-text.html

Copy all Filenames in a Directory to a Text File

Got to know this last week! This works great if you want to save all the filenames in a 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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s