script VBS pour suprimer un fichier selon la date de création
merci de corriger le script ci-dessous, il fonctionnait correctement jusqu'à ce que j'ajoute les lignes concernant la date de création du fchier. en fait, je veux supprimer le fichier outlook.NK2 créer avant la date du 10/05/2010.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Dim fso,ws,AppData,Chemin,fich
Set ws = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
AppData = ws.ExpandEnvironmentStrings("%AppData%")
Chemin= AppData & "\Microsoft\Outlook\Outlook.NK2"
fich=fso.FileExists(chemin)
If (fich.datecreated<10/05/2010) Then
If (fich) Then
Set MyFile = fso.GetFile(chemin)
MyFile.Delete
end if
else
WScript.Quit
end if |