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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| ::: Par Sachadee
::: 11-03-2013
@echo off
Set Source=F:\Travail\Photos
Set Destination=Set Destination=F:\Travail\Photos_Out
set $datef=
set $fichier=
set $moisf=
set $anf=
set $initialef=
set $repf=
setlocal enabledelayedexpansion enableextensions
for /f %%a in ('dir /aa /b') do (
set $fichier=%%a&echo FICHIER EN TRAITEMENT : !$fichier!
set $datef=%%~ta&echo DATE CREATION : !$datef!
set $anf=!$datef:~6,4!&echo ANNEE CREATION : !$anf!
set $moisf=!$datef:~3,2!&echo MOIS CREATION : !$moisf!
set $initialef=!$fichier:~0,1!&echo INITIAL FOTOGRAPHE : !$initialef!
::::::ICI ON DEFINIE LES UTILISATEURS
if !$initialef!==m (set $repf=%destination%\!$anf!\MARIE&echo DESTINATION DE L IMAGE : !$repf!\!$moisf!
call :traitement)
if !$initialef!==r (set $repf=%destination%\!$anf!\RENEE&echo DESTINATION DE L IMAGE : !$repf!\!$moisf!
call :traitement)
if !$initialef!==s (set $repf=%destination%\!$anf!\STEPHANE&echo DESTINATION DE L IMAGE : !$repf!\!$moisf!
call :traitement)
echo PHOTOGRAPHE INCONNUE, INITIALE = !$initialef!>>FOTO.LOG
)
cls
type foto.log
goto end
:traitement
::: ON TEST L EXISTENCE DES REPERTOIRES
if not exist %destination% md %destination%
if not exist %destination%\!$anf! md %destination%\!$anf!
if not exist %destination%\!$anf! md %destination%\!$anf!
if not exist !$repf! md !$repf!
if not exist !$repf!\!$moisf! md !$repf!\!$moisf!
if exist !$repf!\!$moisf! (copy %source%\!$fichier! !$repf!\!$moisf!
echo FICHIER %source%\!$fichier! COPIE
goto end)
echo ERREUR REPERTOIRE NON TROUVE
:end
endlocal |
Partager