bonsoir a tous j'espere que vous pourrez m'aider.
Donc en fait je veu supprimer des fichiers s'il sont plus vieux que 120 jours.
voici l'errer que j'obtiens :
')' attentu à la ligne if (Deltafcb-mid(Filesfcb.DateCreated,7,4),mid(Filesfcb.DateCreated,4,2),mid(Filesfcb.DateCreated,1,2))>0)
Code : 800A03E
voici mon code :
Set Shell = CreateObject("WScript.Shell" )
Set SysEnv = Shell.Environment("SYSTEM" )
Dim FsoProd
Set FsoProd = CreateObject("Scripting.FileSystemObject" )
Function CalculDelDate(Delta)
'Wscript.echo Delta
'Wscript.echo ajoutZero(Day(Date))
if (Day(Date) < Delta ) then
if (ajoutZero(Month(Date))=01) Then
MonthSup=12
else
MonthSup = ajoutZero(Month(Date))-1
End If
DaySup = 31 + (ajoutZero(Day(Date))-(Delta))
'Wscript.echo DaySup
CalculDelDate = Year(Date) & ajoutZero(MonthSup) & DaySup
else
CalculDelDate =((Year(Date) & ajoutZero(Month(Date)) & ajoutZero(Day(Date)))-Delta)
End If
End Function
Deltafcb=CalculDelDate(120)
Set Fsofcb = FsoProd.GetFolder(SysEnv("prod" ) & "\flash\" )
Set LFilesfcb = Fsofcb.Files
for each Filesfcb in LFilesfcb
wscript.echo Filesfcb.DateCreated
'Wscript.echo mid(Filesfcb.DateCreated,6,4),mid(Filesfcb.DateCreated,3,2),mid(Filesfcb.DateCreated,1,2)
'set DateSce=mid(Filesfcb.DateCreated,6,4),mid(Filesfcb.DateCreated,3,2),mid(Filesfcb.DateCreated,1,2)
'wscript.echo DateSce
'wscript.echo mid(Filesfcb.DateCreated,7,4),mid(Filesfcb.DateCreated,4,2),mid(Filesfcb.DateCreated,1,2)
if (Deltafcb-mid(Filesfcb.DateCreated,7,4),mid(Filesfcb.DateCreated,4,2),mid(Filesfcb.DateCreated,1,2))>0) then
wscript.echo Filesfcb.Name
End if
next
Est ce que quelqu'un a fait du code similaire une fois. SVP j'ai besoin d'aide.
Message édité par overider le 15-04-2006 à 03:44:44