Reputation: 31
How do I create a batch file that creates a list of files in a folder along with date last accessed and size?
My code is this so far:
dir /b /s > fileslist.txt
and creates a list of the contents in the folder the batch file is located like this:
C:\Users\UserOne\Documents\3D Designs
C:\Users\UserOne\Documents\Adobe
C:\Users\UserOne\Documents\AirDroid
C:\Users\UserOne\Documents\Amazon Downloader Logs
C:\Users\UserOne\Documents\AppScan
C:\Users\UserOne\Documents\Audacity
Upvotes: 2
Views: 1041
Reputation:
This should be closer to what you want:
@echo off
for /f "skip=5 tokens=1-4*" %%A in ('dir /ta /s /a-d') do (
if "%%A" NEQ "Directory" if "%%E" NEQ "" if "%%B" NEQ "Dir(s)" echo %%E ^|^| %%A %%B %%C %%D
)
pause
Output:
C:\fileName.ext || 2017/10/4 00:00 AM 42
The code does:
C:\fileName.ext || [last accessed date time] [byte count]
C:\folderToTest || [last accessed date time]
Upvotes: 1