Reputation: 403
I frequently use a batchscript dirlist.bat to generate a quick searchable text to find file information.
dirlist.bat
dir *.* /b/s >dirlist.txt
now I need additionally date and size information. As this would build a multicolumn list a csv-listoutput would be prefered.
This is my inspiration:
dir *.doc? /n/s >dirlist.txt
but I get a mixed multiline output. Filematches and folder summaries are intermingled.
Do you know a script approch to list the base information of each filematch into one line?
Upvotes: 0
Views: 757
Reputation: 38604
You could probably use ForFiles
.
Example:
@(ForFiles /S /M *.* /C "Cmd /C Echo @File,@FDate,@FSize")>DirList.txt
Upvotes: 1
Reputation:
Why not just run a loop and get the date and filesize with it?
for /f %i in ('dir /b/s *.doc?') do echo %~zti %~dpfi >>dirlist.txt
you can dump the dir
command and simply use the for /d
and /r
(recursive) search. See for /?
Upvotes: 1