[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Backing up files

I have to HDD (c,d). My data files is storing at C. I want to write a VB exe program that will copy files to D as backup, it must only copy different files to D at a specific time automatically. This program will run during PC power on.

Can anybody help me?

Note : I have VB6
0
itacan
Asked:
itacan
1 Solution
 
dosylCommented:
Maybe, Zip it using XCeed zip  (www.xceedsoft.com). Your zip file will be compatible to WinZip!

Or you can use Pkzip,PkUnzip.
0
 
p_biggelaarCommented:
Please tell me: only a copy? like in old times the dos copy command used to do?
0
 
p_biggelaarCommented:
Furthermore I'd like to know how you want to determine what files have to be copied (a particular directory, all files of a particular type, some files that are hardcoded)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
itacanAuthor Commented:
Yes p__biggelaar
but i don't want to copy same files only different ones.
0
 
itacanAuthor Commented:
A directory with all subdirectories
0
 
st_steveCommented:
even if you succeeded in writing code for that function, it would slow down windows startup considerably if you have a lot of midified files....unless you program it to run it in parallel to Windows and in background....
0
 
vbyuvalCommented:
Hi
You can use CopyFile command (or is it FileCopy ?) however it goes like that :
CopyFile Source,Detination

About the time you can use the Timer control .

If that waht are looking for and you need the exact code I can send you a project with a sample ,just write here your @mail .

                                                                                Enjoy
                                                                             Yuval Amir
0
 
p_biggelaarCommented:
Do you think you can get a copy of the scrrun.dll (it's one of the dll's that ships with VBscript)

If you can, the answer to your question will be quite easy.

The only thing you'll have to do now is insert code that looks like this:

Private Sub Command1_Click()

Dim x As New Scripting.FileSystemObject
   
    x.CreateFolder "D:\MyBackup"
    x.CopyFolder "C:\My Documents\*", "D:\MyBackup", True

End Sub

(If I'm not mistaking it should be shipped with VBscript, Office 97, Office 2000, anyway, when you've got it it should be registered and be located in the windows/system directory)

To make sure it will fire on time, you can have a timer control check for the current time (the interval you specify is up to you).
0
 
p_biggelaarCommented:
Forgot to mention:
You should add a reference to the Microsft Scripting Runtime (the scrrun.dll)

Of course the copyfolder copies all subdirectories and files in it at once using the wildcard.
0
 
itacanAuthor Commented:
Thank You
0
 
p_biggelaarCommented:
You're welcome
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now