Wednesday, September 10, 2014

Windows Command to get the list of file names in a folder


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

Navigate to the directory which has the files and type the following command 

DIR /B /O:N   It will display the list of file names in current directory

DIR /B /O:N /S It will display the list of file names including sub directories

DIR /B /O:N > filename.txt  It will redirect the output to text file

To save file names from any sub-directories in the current folder, just add /S like 
This will save all the file names in the current directory to a text file. The text file will be saved in the same directory. 



No comments:

Post a Comment