Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A backup utility code.

Utility Program

A backup utility code.

by  ramani  Posted    (Edited  )
*******************************************
** 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]
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top