Supporting Techniques - Listing files and folders

It is often useful to obtain a list of the files in a folder to do this. The TREE or DIR commands can do this.

Shift + Right-click on a folder (to save keying-in the path); pick:

This opens PowerShell in that folder, type CMD and paste in the following commands as required:

For a list of files:

tree /f _ListOfFiles.txt

will produce a flat list of files with full paths.

For a tree list of folders only:

tree /a FolderTreeList.txt

For a flat list of only folders with full paths use the DIR command:

Dir /b/a:D/s folderlist.txt

The DIR switches used are:

  • /b = bare without heading or summary
  • /a:D = folders (directories) only
  • /s = subfolders

For complete lists of command options enter:

DIR /?