Ver Mensaje Individual
  #8 (permalink)  
Antiguo 22/04/2008, 10:08
Avatar de David
David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 20 años
Puntos: 839
De acuerdo Re: eliminar base de datos por fecha

Para que no tengas que copiar el código dos veces, puedes hacer así:
Código:
 
Sub DeleteBackup(ByVal Path As String)
Dim SF As Scripting.File
 
Set FSO = New Scripting.FileSystemObject
For Each SF In FSO.GetFolder(Path).Files
If SF.DateCreated < Now - 5 Then Kill Path & SF.Name
Next
End Sub
Código:
 
DeleteBackup "C:\WINDOWS\Pollo Feliz\Pv Traslados\tickets\"
DeleteBackup "C:\WINDOWS\Pollo Feliz\Pv Traslados\Inventarios\"
Muy buen aporte, Avellaneda.

No obstante, william_085, para que te funcione, no deben ser carpetas tus copias de respaldo, sino archivos...
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.