Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Backup and Restore a file


'backup
If MsgBox( "Are you sure?" , vbOKCancel + vbQuestion, "Backup Data" ) = vbOK Then
   FileCopy InfoFileName, InfoFileName & ".old"
End If

'restore
If MsgBox( "Are you sure?" , vbOKCancel + vbQuestion, "Restore Data" ) = vbOK Then
   FileCopy InfoFileName & ".old" , InfoFileName
End If