Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2013, 18:45
karlosc
 
Fecha de Ingreso: julio-2012
Ubicación: panama
Mensajes: 19
Antigüedad: 11 años, 9 meses
Puntos: 0
Ejecutar evento

Buenas noches Sres. del foro recurro a ustedes para que me ayuden con este codigo.
que me facilitaron en la red pero no se como lanzarlo mediante un boton.

Private Sub moveOldfiles(sourceFolderPath As String,
destinationFolderPath As String,
thresholdCreationTime As Date,
Optional fileExtension As String = Nothing)
Dim sourceFolder As New DirectoryInfo("D:\NPRUEBA\bal")
Dim files = sourceFolder.GetFiles(If(String.IsNullOrEmpty(file Extension),
"*.exe",
"*.exe" & fileExtension))
For Each file In files
'Move the file if it was created before the threashold date/time.
If file.CreationTime < thresholdCreationTime Then
file.MoveTo(Path.Combine("D:\ENSAYO", file.Name))
End If
Next
End Sub

Espero me puedan ayudar

Saludos,