Reputation: 175
In Windows command prompt, I'm trying to list only path, file name and size, of all files including in a folder and its sub folders. Like:
dir /s /b /a-d "C:\MainFolder\"
Problem is that I don't know how to show size of file. Is it possible?
Upvotes: 3
Views: 26297
Reputation: 130819
From the command line:
for %F in ("c:\MainFolder\*") do @echo %~zF %F
Double up the percents if you use the command in a batch file.
Type HELP FOR
or FOR /?
from the command prompt for more information on the various values that are available with FOR variable expansion.
Upvotes: 5