I have a list of sales orders in a folder. I want a batch script that can output into a txt file, when were all the files last accessed but not necessarily modified.
On partitions with NTFS file system there are 3 file dates: creation date, last modification date and last access date.
The command
dir "path to directory" /TA /OD
lists all files of the directory according to last access date with last accessed file at bottom.
dir "path to directory" /TA /O-D
list the files in reverse order with last accessed file at top.
It is of course possible to redirect the output into a file by appending >"Name of list file with path.log"
But don't trust the last access time too much as it is really not reliable on when a file was last time opened for read only.
For more parameters of command dir
open a command prompt window and enter dir /?