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,