Code Scraps: Get a list of all content in a directory on Windows

I recently posted a code scrap for getting all content of a directory in Linux. Here is the same code scrap but for Windows.

C:\TestDir\> dir /b /s > C:\temp\files.txt

This command will generate a text file with the full path to every file within the directory your command line session is in.

For example:

C:\TestDir\file1.txt
C:\TestDir\file2.txt
C:\TestDir\Dir1\file3.txt
C:\TestDir\Dir1\file4.txt
C:\TestDir\Dir2\file5.txt

One thought on “Code Scraps: Get a list of all content in a directory on Windows

Leave a Reply

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