Visual Basic - RE:copiar arxivos

Life is soft - evento anual de software empresarial
 
Vista:

RE:copiar arxivos

Publicado por Benjo (679 intervenciones) el 12/01/2005 12:09:17
pepe, tal cual como vos escribiste, podés utilizar FileSystemObject para manipular los archivos del sistema.
En un CommandButton agregás el siguiente código

Dim fso As New FileSystemObject
If fso.FileExists("C:\Autoexec.bat") Then
On Error Resume Next
fso.CreateFolder "C:\Backup"
fso.CopyFile "C:\Autoexec.bat", "C:\Backup\", True
'True intenta sobreescribir el archivo
End If
Set fso = Nothing

Previo a todo ello, desde el Menú Proyectos -> Referencias, agregás una referencia a Microsoft Scripting Runtime, sino el ObjectFileSystem no se puede crear.

Suerte
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder