VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4380
   ClientLeft      =   2136
   ClientTop       =   1788
   ClientWidth     =   5412
   LinkTopic       =   "Form1"
   ScaleHeight     =   4380
   ScaleWidth      =   5412
   Begin VB.CommandButton Command2 
      Caption         =   "Delete Copy of Favorites"
      Height          =   612
      Left            =   1920
      TabIndex        =   2
      Top             =   2760
      Width           =   1332
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Copy Favorites"
      Height          =   612
      Left            =   1800
      TabIndex        =   1
      Top             =   1200
      Width           =   1332
   End
   Begin VB.Label Label3 
      Caption         =   $"Form1.frx":0000
      Height          =   612
      Left            =   360
      TabIndex        =   4
      Top             =   3480
      Width           =   4572
   End
   Begin VB.Label Label2 
      Caption         =   "This second button will delete the copied folder in your app's running directory."
      Height          =   492
      Left            =   360
      TabIndex        =   3
      Top             =   2040
      Width           =   4572
   End
   Begin VB.Label Label1 
      Caption         =   "The first button will make a copy of your favorite folder and put it in your app's running directory."
      Height          =   492
      Left            =   360
      TabIndex        =   0
      Top             =   480
      Width           =   4572
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
On Error GoTo Handler:

    'Declare an object to hold our File System object
    Dim fsoFileObject As Object
    Dim blnFolderExists As Boolean
    
    'Set the object to a new FileSystemObject
    Set fsoFileObject = CreateObject("Scripting.FileSystemObject")
    
    'Just checking to see if the folder exists.  If it does, we delete it.
    'If we don't delete it and you try to create the folder when one exists,
    'an error is produced.
    If fsoFileObject.FolderExists(App.Path & "\copiedfavorites") Then
        fsoFileObject.DeleteFolder App.Path & "\copiedfavorites", True
    End If
    
    'This creates a new folder in your applications directory called "copiedfavorites"
    fsoFileObject.CreateFolder (App.Path & "\copiedfavorites")
    
    'This line will copy all of the folders in the favorites, and the next line
    'will copy all of the files that aren't in folders.  You are going to have
    'to change the path to your favorites folder, because mine is obviously not
    'going to work on your computer.
    fsoFileObject.CopyFolder "E:\Documents and Settings\brian.russell\Favorites\*", App.Path & "\copiedfavorites"
    fsoFileObject.CopyFile "E:\Documents and Settings\brian.russell\Favorites\*", App.Path & "\copiedfavorites"
    Exit Sub

Handler:
    MsgBox (Err.Description)

End Sub

Private Sub Command2_Click()
On Error GoTo Handler:

    'Declare an object to hold our File System object
    Dim fsoFileObject As Object
    
    'Set the object to a new FileSystemObject
    Set fsoFileObject = CreateObject("Scripting.FileSystemObject")
    
    'If it exists, we delete it, if not, we don't
    If fsoFileObject.FolderExists(App.Path & "\copiedfavorites") Then
        fsoFileObject.DeleteFolder App.Path & "\copiedfavorites", True
    End If
    Exit Sub

Handler:
    MsgBox (Err.Description)
End Sub
