Results 1 to 3 of 3

Thread: Backup program type thing

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    0

    Question Backup program type thing

    Hello all,
    ive just started learning VB properly and i want to make a backup type program to backup normal files, ive had a look round on loads of places but all i could find was about backing up sql things and stuff like that..
    so what i want to know now is how to get a text box with the browse button so i can select a folder and have a button below it that copies the contents of the folder to a destination,
    thats all i want to know now then i will do some more research about how to add it to the window task schedular thing etc..

    Thank-you all

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Backup program type thing

    Welcome to VBForums

    There is code to browse for a folder here: http://www.vbforums.com/showpost.php...15&postcount=2

    In terms of finding out what files are in the folder you can use the Dir function (see VB's help for an explanation and examples), and to copy a file you can use the FileCopy statement (again, see VB's help).

  3. #3
    PowerPoster Ellis Dee's Avatar
    Join Date
    Mar 2007
    Location
    New England
    Posts
    3,530

    Re: Backup program type thing

    Using Dir() is not advisable in this situation because it does not lend itself well to recursive functions, which is what you'll be faced with if the folder has subfolders.

    I would either use ShFileOperation API to copy an entire directory tree in one shot, or create a loop using FindFirstFile and FindNextFile API.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width