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 53 54 55 56 57 58 59 60 61
|
:::PAR SACHADEE
:::www.bbat.forumeiros.com
@echo off
setlocal enabledelayedexpansion
:::DEF DES VARIABLES
set $racine=c:\podcast
set $temp=15
::::ON TEST LA PRESENCE D'UN MP3 SI IL EXITE ON TRAITE
::::SINON ON ATTEND 15 SECONDE ET ON RETESTE
:start
pushd %$racine%
if existe *.mp3 goto:traitement
ping localhost -n %$temps% -w 1000 > nul
goto:start
:traitement
for %%a in (*.mp3) do (set $nom_mp3=%%a)
::::DECOMPOSITION DU NOM
for /f "tokens=1,2,3,4,5 delims=_" %%a in ('echo !$nom_mp3!') do (set $rcf86=%%a&echo RCF86= %$rcf86%
set $codecourt=%%b&echo CODE COURT= %$codecourt%
set $date=%%c&echo DATE= %$date%
set $heure=%%d&echo HEURE= %$heure%
set $sujet=%%e&echo SUJET= %$sujet%)
:::Creation de la datet et de l heure standardisee pour xml
set $date_xml=%$date:~0,4%/%$date:~4,2%/%$date:~6,2%&echo DATE XML= !$date_xml!
set $heure_xml=%$heure:~0,2%:%$heure:~2,2%&echo HEURE XML= !$heure_xml!
:::Construction du nom complet pour le xml
set $nom_mp3_xml=%$codecourt%_!$date_xml!_!$heure_xml!_%$sujet%.mp3&echo NOM MP3 POUR CHAMP XML = !$nom_mp3_xml!
:::::::A FAIRE
:::Création du nom du mp3 (sans $sujet)
:::rennomage du mp3 avec le nouveau nom
:::création du xml avec nouveau nom.xml
:::transfert FTP des fichiers
:::Destruction des fichiers
:end
goto:start |
Partager