|
-
Aug 20th, 2008, 02:17 PM
#1
Thread Starter
New Member
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
-
Aug 20th, 2008, 03:59 PM
#2
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).
-
Aug 20th, 2008, 08:08 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|