I have scripted AnalDT.bat to determine the files that have not been accessed, or modified, in the past N days.

The syntax for using AnalDT.bat is:

AnalDT A|C days Path


<b>A|C</b>       <b>A</b> indicates check for accessed, <b>C</b> indicates check for changed/created (<b>W</b>ritten).

<b>Days</b>      Is the number of days in the past to check, from <b>0</b>-9999.

<b>Path</b>      is the Drive Letter or Folder to check.
The output is displayed on the console, in the following CSV format:

"Fully Qualified File Name","YYYYMMDD","A|W"

You can redirect the output to a file using:

AnalDT A|C days Path>filename.

NOTE: AnalDT.bat uses DatePorM.bat, which must be in a folder that is in your PATH.

AnalDT.bat contains:

@echo off
if \{%3\}==\{\} goto err
set AC=%1
set /a days=10000%2%%10000
if %days% LSS 0 goto DTN
set /a days=0 - %days%
set where=%3
if /i "%AC%" EQU "A" set AC=A&goto OK
if /i "%AC%" NEQ "C" goto err
set AC=W
if not exist %where% goto errnf
call DatePorM %days% DT
set DTC=%DT:~6,4%%DT:~0,2%%DT:~3,2%
for /f "Tokens=*" %%a in ('dir /b /s /a /a-d %where%') do (
 for /f "Tokens=1,2,3 Delims=/ " %%f in ('dir /a /T%AC% /4 "%%a"^|FIND "/"') do (
  set MM=%%f
  set DD=%%g
  set YY=%%h  
  set YY=!YY: =!
  set /a MM=100!MM!%%100
  set /a DD=100!DD!%%100
  if !MM! LSS 10 set MM=0!MM!
  if !DD! LSS 10 set DD=0!DD!
  set DTF=!YY!!MM!!DD!
  if "!DTF!" LEQ "%DTC%" @echo "%%a","!DTF!","%AC%"
goto :EOF
@echo Syntax: AnalDt A^|C days Path
goto :EOF
@echo AnalDT %AC% %2 %where% - NOT FOUND.