Follow

Recursive directory listing in Windows

Question: How do I get a recursive directory listing
Answer:
Reference - http://superuser.com/questions/653860/list-files-recursively-showing-only-full-path-and-file-size-from-windows-command

A simple answer is:

dir /b /s /a:-D > dirlisting.txt & more dirlisting.txt<

The output is redirected to the file dirlisting.txt and displayed on screen (Please delete file after use)

Alternatively:

To retrieve the size as well:

A simple answer is:

@echo Results on %DATE% for %CD% >> dirlisting2.txt & echo off & for /f "delims=*" %A in ('dir /s /b /a:-d') do echo %~fA %~zA >> dirlisting2.txt

Note: You must type

echo on

to get the prompt back after the command above completes

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.