1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| @echo off
MD "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\Temp"
Set /A J=%date:~6,4%
Set /A M=%date:~3,2%
Xcopy "G:\Mes documents" "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\Temp" /I /E /Y /d:%date:~3,2%-21-%date:~6,4%>>"pa_copier.txt"
echo -----------pa_copier.txt
more pa_copier.txt
Xcopy "G:\Mes documents" "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\Temp" /I /E /Y>>liste.txt
echo -----------liste.txt
more liste.txt
Xcopy "G:\Mes documents" "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\sauvegarde" /I /T /E /Y
echo -----------Commande FOR /F Findstr
For /F "Tokens=1,2,3* Delims=G" %%I In ('Type "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\sauvegarde\liste.txt"') Do (
findstr /C:"G%%I" "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\sauvegarde\pa_copier.txt"
echo %ERRORLEVEL% c errorlevel
If ERRORLEVEL 1 (
For /F "Tokens=1,2* Delims=\" %%A in ("G%%I") Do Move "G%%I" "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\sauvegarde\%%C"
)
)
pause
RD /S /Q "I:\09_dpt_protos\09_secretariat_communication\02_confidentiel\00-Gestion du I\Temp"
del pa_copier.txt
del liste.txt
pause |