CCTV TECH
Nassau, Bahamas
Search this site Search Help
Default
Newest
Oldest
Your Ad here
All CCTV Pages
All Visual Basic
Real Estate in The Bahamas from $25,000
All Categories
Partners
 
 
 
Backup

This script backs up a folder, called "backup", on your C: drive, to your U: drive. In this example the U: drive would be a USB drive, but you can change the letter to any drive you want. In addition, it makes a backup of the old backup, on the backup drive.
Option Explicit

Const Source 	     = "C:\backup"
Const Destination    = "U:\backup"
Const DestinationOld = "U:\backup_OLD"

Dim objFSO
On Error Resume next

Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Source) Then
   Dim msg
   msg = MsgBox("Press OK to begin backup to " & Destination, vbOkCancel)
   If msg = vbOk Then
       If objFSO.FolderExists(Destination) Then
           If objFSO.FolderExists(DestinationOld) Then
               objFSO.DeleteFolder(DestinationOld)
           End If
           objFSO.CopyFolder Destination, DestinationOld, True
           objFSO.DeleteFolder Destination
       End If
       objFSO.CopyFolder Source, Destination, True
       If Err Then
           MsgBox "Error!!!"
       Else
           MsgBox "Backup Complete"
       End If
   Else
       MsgBox "Backup cancelled by user."
   End If
Else
   MsgBox "Backup failed." & vbCrLf & "Source folder does not exist."
End If
Set objFSO = Nothing


CCTV | DVR | Video Surveillance | Day Night | CCTV Cameras | Remote Video | Tech Support | Software | Scripts | Visual Basic | Articles | Yellow Pages | Real Estate
Copyright © 2001/2012 BahamasSecurity.com
 
Website hosted in Nassau, The Bahamas