Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FoxPro FAQ

Utility Program

Fast backup of all files in directory to ZIP-file by broekhuis
Posted: 24 Feb 04

There is an easy way to backup your daily work! I usually backup the directory with my application once a day.

I have now automated this process so that the backup file (ZIP-file) is stored in a subdirectory "backup". The filename is determined automatically and is made from the date in ISO format, for example the backup of February 24 2004 becomes "20040224.ZIP". Further the backup is extremely fast! You can for example run the backup program in each directory with valuable data!

The basis is the free XZIP.DLL component (see www.XStandard.com for download). I modified the code from one of the threads on this forum in order to make the code backup the way subscribed above. You can copy the code below and paste it into a prg, which can be used in a project, compiled, etc..

set century off
set date to italian
PUBLIC objFile
objFile = ""

oZip = CreateObject("XStandard.Zip")
oFS = CREATEOBJECT("Scripting.FileSystemObject")
lcZipName = SYS(2003)+"\backup\"+DTOS(DATE())+".zip"

WAIT WINDOW "Starting backup..." NOWAIT

For each objFile in oFS.GetFolder(SYS(2003)).Files

WAIT WINDOW "Backup " + ALLTRIM(DTOS(DATE())) + ".ZIP ready!" timeout(1)



Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close