Code scraps: Get all files of a type in Windows

This extends upon my previous code scrap for listing all files in Windows. If you want to produce a list of just a certain type of files in a directory and all sub-directories, you can use the following command on the Windows command line:

[codeStart]dir /b /S *.csproj > c:\temp\projects.txt

The above will in this instance, write a list of all CSPROJ files (C# Project definitions) to a file called projects.txt in the C:\Temp directory.

You can read the previous code scrap here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.