17 thoughts on “Listing all Files Recursively in Windows

  1. @logicslayer
    Thank you very much!
    I found the solution some months ago (my post was written in November), but thank you anyway!

  2. This is wrong (but close).
    It says it “Saves the list of all files in a folder in windows – recursively”

    when in fact it “Save the list of all files AND FOLDERS in a folder in windows – recursively”

    how do you get a list of files only (assuming some files don’t have extentions)?

  3. I am intrigued to know if you can dir *.pls recursively, I am also then looking to basically delte every pls file within this structure. However, there is 299gb and some 25k files to go through..I have a master DB of the Library but dont want all the awfully filenamed, and frankly rubbish pls files in amongst it all.

  4. For only a list of files (with paths, but excluding directories only) use the /A:-D parameter after the path (before the /B parameter)

  5. Thanks!
    I used
    dir /s /b /AD > file.txt to list folders only
    per posting number 5 above, as deleting folders via the GUI was failing on long path names.

    Even the above command reported a few failures on long paths ( very long ). What is the path/filename length limitation now ( I recall 256 characters from several years ago )?

  6. You could also search for:
    dir /s /b C:\Windows\Temp\v*.msi

    -> recursive under C:\Windows\Temp
    -> files that match v*.msi

    🙂 Mayra

Leave a Reply

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