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
| @echo off
rem récupération du chemin
set [REP]=%cd%
rem création repertoires
mkdir "%[REP]%\ok"
mkdir "%[REP]%\erreur"
rem récupération du nom des photos
dir /b *.jpg >> nomPhoto.txt
FOR /F %%i IN (nomPhoto.txt) DO set nom=%%i
rem création vbs qui sera complété
echo stRep="%[REP]%" >> .\dimensions.vbs
echo stFichier ="%nom%" >> .\dimensions.vbs
echo Set oShell = CreateObject("Shell.Application") >> .\dimensions.vbs
echo Set oFolder = oShell.Namespace(stRep) >> .\dimensions.vbs
echo Set oFichier = oFolder.Items.Item(stFichier) >> .\dimensions.vbs
rem 'Affiche les propriétés étendues du fichier
echo Wscript.Echo "[" ^& 26 ^& "] " ^& oFolder.GetDetailsOf(oFolder.Items, 26 ) ^& " : " ^& oFolder.GetDetailsOf(oFichier, 26) >> .\dimensions.vbs
rem test les dimensions et deplacement fichiers
set valeur=[26] Dimensions : 283 x 377
cscript dimensions.vbs
if "%valeur%"=="[26] Dimensions : 283 x 377" copy %nom% "%[REP]%\ok"
if not "%valeur%"=="[26] Dimensions : 283 x 377" copy %nom% "%[REP]%\erreur"
rem suppression des fichiers tempo
del .\dimensions.vbs
del .\nomphoto.txt |