I have a folder and using batch file I want to know whether its modified(any file created or modified in it) today or not.
Below is command to get count of all files in a folder. I am new in batch files and don't know how to get it, pl help.
set MyFolder=D:\folder1
SET file_Cnt=0
for %%o IN (%MyFolder%/*.*) DO (
SET /A file_Cnt=file_Cnt+ 1
)
echo %file_Cnt%
Edit :- I got this solution but only problem is I want to set a variable(for total count of files modified) here which can be used later.
forfiles /S /P "%MyFolder%" /M "*" /D +0 /C "cmd /C if @isdir==FALSE echo _" | find /C "_"
Edit2:- I have tried below commands to set the variable but not working.
forfiles /S /P "%MyFolder%" /M "*" /D +0 /C "cmd /C if @isdir==FALSE echo _" | find /C "_"
echo %_% --getting echo off message
for /F %%N in ('forfiles /S /P "%MyFolder%" /M "*" /D +0 /C "cmd /C if @isdir==FALSE echo _" ^| find /C "_"') do set "NUMBER=%%N"
echo %NUMBER% --getting echo off message
echo %%N --getting echo off message