Programming a backup script

Maldian

Senior member
Aug 27, 2004
422
0
0
I have VB6 and I am new to programming. I have been given a project to complete and yet I am not sure how to do it. So basically I am looking for some help here if anyone can provide assistance.

I have to come up with a program where it will immediately select a specific folder that has to be backed up to a flash drive (Drive E: ) I have the GUI setup already, but now not sure how Im supposed to get it to work. This program has to be easy for the non-computer savvy people to be able to use it. Basically when they open the program up, they just click the buttong "Backup Data" and it copies all the data in an already specified folder to the E" Drive.

Can anyone help with this?
 

Maldian

Senior member
Aug 27, 2004
422
0
0
Well I suppose I could add in where they could choose the drive, but the directory they will be copying from will always remain the same.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,326
4,000
75
I've done that with batch files/scripts. Forget VB, and just type the following in a file:
Code:
xcopy /S /Y [source folder] E:\[destination folder]
Rename that file to something like backup.bat, and double-click it to run it. Personally, I always zipped my backups, but this xcopy is technically more reliable.
 

Maldian

Senior member
Aug 27, 2004
422
0
0
Well now what is the command to tell it to find and select the flashdrive for the backup location?

Seems that corporate here keeps changing their mind.
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Well now what is the command to tell it to find and select the flashdrive for the backup location?

Code:
xcopy /S /Y [source folder] <flash drive letter>:\[destination folder]
 

Maldian

Senior member
Aug 27, 2004
422
0
0
Yeah I know that part... what I mean is that my flashdrive may pop up on drive F... and yours may be drive E and another's would be drive G... is there a command that will go detect and automatically put the drive letter in the script location for the backup to go?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
There are win32 functions to enumerate available drive letters, probably a Google search will find VB6 code for this. Unless you have drive-mapped network shares it's probably the highest drive letter.

Also, something to consider is whether you want to just copy the files or compress them into a single, dated archive. PKZip and WinZip have command-line switches, and there might be some for a freeware app like 7zip.
 

Cogman

Lifer
Sep 19, 2000
10,280
131
106
There are win32 functions to enumerate available drive letters, probably a Google search will find VB6 code for this. Unless you have drive-mapped network shares it's probably the highest drive letter.

Also, something to consider is whether you want to just copy the files or compress them into a single, dated archive. PKZip and WinZip have command-line switches, and there might be some for a freeware app like 7zip.

This is why it is pretty much the best solution to have the user pick the destination. There is no really guarantee that anything will be anywhere.

There is a standard windows file dialog that you should use for picking files. I'm too lazy to look it up though
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
One easy option would be for the USB drive to have a file on it that is always there. Like a marker (could be a hidden file so the user can't see it). Then just have a batch file check each drive letter for said file.

Theoretically, if autorun is enabled, you could just put the copy script on the usb drive and have it backup when it is inserted.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |