Skip to content


How save a list of all files in folder + subfolders

(in Windows via command line)

Go to Start Menu → Run (keyboard shortcut: [windows key]+R) and run “cmd”
Browse to the folder you want to list
Then type: dir /s > listing.txt

This is assuming you want to create a file named listing.txt and put the list in it.

If you want to append the listing to an existing file, use a double > :
dir /s >> listing.txt.

If you want to output the result to the console and not to a file, just skip the > listing.txt part.

If you don’t want to browse to the folder, you can specify it as an argument to dir:
dir c:\somefolder /s > c:\listing.txt.

Posted in Windows.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA