1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
SET MONREP=C:\Users\DELL\Desktop\courrier\
for /f "delims=" %%a In ('dir /ad/b/s %MONREP% ') Do (
set c=%%a
set c=!c:*courrier=courrier!
dir %%a /OD /T:W > tmp3.txt
rem On ne garde que les fichier modifiés en 2013 et on les déplace dans le dossier spécifique
FINDSTR /V /C:"<REP>" "tmp3.txt"|findstr /C:"/2012" > tmp3
for /F "tokens=4" %%I IN (tmp3) DO (
set "c=%%a"
set "c=!c:*courrier=courrier!"
echo fichier source %%a\%%I
echo destination C:\Users\DELL\Desktop\DestinationCourrier\courrier\2013\%c%
copy %%a\%%I C:\Users\DELL\Desktop\DestinationCourrier\courrier\2013\%c%
) |