I have a folder MyFolder and it contains 3 sub-folders say A,B and C.
I want to copy those sub-folders which are modified today.
The command for /D %%A in ("D:\MyFolder*") do ( echo **%%~fA )** provides me all 3 sub-folders, now I am calling another loop and passing %%~fA(which is current folder in loop) to get to know is there any modifications made in this folder or not. But I am getting echo off.
set LocalFolder=D:\Backup\1
for /D %%A in ("D:\MyFolder\*") do (
echo %%~fA
for /F %%N in ('forfiles /S /P "%%~fA" /M "*" /D +0 /C "cmd /C if @isdir==FALSE echo _" ^| find /C "_"') do set "NUMBER=%%N"
echo %NUMBER%
if %%N GTR 0 xcopy "%%~fA\*.*" "%LocalFolder%\" /s/e/k/f/c
)