Oct 13, 2017

How to create a txt file containing a list of all files and sub-folders

In a cmd window,
"dir /b" will list all files and sub-folders in a folder.
To make a list file (list.txt) containing all information that comes after the "dir /b" command,
"dir /b < list.txt"

If you want to list files only,
"dir /a:-d /o:n /b  < list.txt"

If you want to list sub-folders only,
"dir /a:d /o:n /b  < list.txt"

"/o:n" results in an alphabetically sorted list


No comments:

Post a Comment