Using DatePorM.bat, I have scripted FilesChangedYesterday.bat to generate a .txt file of file names that were created or modified yesterday.

The syntax for using FilesChangedYesterday.bat is:

FilesChangedYesterday Drive: ReportFolder \[/A\]

Where Drive: is the drive letter (or folder path) you want enumerated, ReportFolder is the folder path that will contain a YYYYMMDD.txt file with the files that were changed yesterday, and /A is an optional parameter that will only find yesterday's files if their archive bit is set.

NOTE: FilesChangedYesterday.bat assumes a MM/DD/YYYY date format, but you can easily change that by altering the set report="%report%\%yesterday:~6,4%%yesterday:~0,2%%yesterday:~3,2%.txt" line.

FilesChangedYesterday.bat contains:

@echo off
If \{%2\}<h1><a name="_echo_Syntax_FilesChangedYesterday_Drive_ReportFolder_A_amp_goto_EOF_if_not_exist_1_echo_FilesChangedYesterday_1_not_found_amp_goto_EOF_if_not_exist_2_echo_FilesChangedYesterday_2_not_found_amp_goto_EOF_setlocal_set_drv_1_set_report_2_call_DatePorM_1_Yesterday_set_report_report_yesterday_6_4_yesterday_0_2_yesterday_3_2_txt_set_report_report_set_dirc_dir_drv_b_s_a_d_if_i_3_">\{\} @echo Syntax: FilesChangedYesterday Drive: ReportFolder \[/A\]&goto :EOF
if not exist %1 @echo FilesChangedYesterday %1 not found.&goto :EOF
if not exist %2 @echo FilesChangedYesterday %2 not found.&goto :EOF
setlocal
set drv=%1
set report=%~2
call DatePorM -1 Yesterday
set report="%report%\%yesterday:~6,4%%yesterday:~0,2%%yesterday:~3,2%.txt"
set report=%report:\\=\%
set dirc=dir %drv% /b /s /a-d
if /i \{%3\}</a></h1>\{/A\} set dirc=%dirc% /aa
for /f "Tokens=*" %%a in ('%dirc%') do (
 for /f "Tokens=1" %%b in ('@echo "%%~Ta"') do (
  if "%%~b" EQU "%Yesterday%" @echo %%a>>%report%
 )
)
endlocal