*******************************************
** A simple function to do backup.
*******************************************
** by Subramanian.G (ramani)
** FoxAcc Software
** ramani_g@yahoo.com
** Last modified : 11 October, 2002
** provided as freeware
*******************************************
** You need CabArc tools for the following.
** You can download CabArc tools from...
** http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B310618
**
** How to use ....
** lcSource = "c:\myDirectory\*.*"
** lcDestination = "c:\myBack\myBack1.CAB"
** =gsCabBack(mySource,myDestination)
*******************************************
** Instead of CAB, you can use WinZips's
** command line utility also, in which case
** change the code 'lcCmd' suitably. [color blue]
*******************************************
FUNCTION gsCabBack
LPARAMETERS lcSource, lcDestination
LOCAL lcCmd, lnSuccess, loShell
IF !EMPTY(lcDestination) OR !EMPTY(lcSource)
lcCmd = "CABARC -r -p N " + ;
lcDestination + SPACE(1) + lcSource
loShell = CREATEOBJECT("wscript.shell")
lnSuccess = loShell.Run(lcCmd,1,.t.)
IF lnSuccess = 0
=MESSAGEBOX("BackUp successful.",0+64,"Backup OK!")
ELSE
=MESSAGEBOX("BackUp failed",0+16,"Caution")
ENDIF
ENDIF
*******************************************
** EOF
*******************************************
[color black]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.