Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting & Copying directories
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00432204
Message ID:
00432229
Views:
28
>Hi Guys
>I need to write either a DOS batch file or a very short vfp prg to copy a directory (with subdirectories) from 1 HDD to another as a daily backup. Any ideas?
>TIA - John

John,

I use a VBScript file to this daily. It looks something like this:
' Backup2.vbs

Const FOF_NOCONFORMMKDIR = &H200
Const FOF_NOCONFIRMATION = &H010
Const FOF_SIMPLEPROGRESS = &H100
Dim cSource, cTarget, oFSO, oShell, oFolder
cSource = "C:\Source"
cTarget = "F:\Target"
Set oShell = CreateObject("Shell.Application")
Set oFolder = oShell.Namespace(cTarget)
oFolder.CopyHere cSource, FOF_NOCONFORMMKDIR + FOF_NOCONFIRMATION + FOF_SIMPLEPROGRESS
The above script will produce the familar Windows progress dialog. This requires that the Active Desktop be installed. You can tell by checking the version of Shell32.dll. If it is, the version will be 4.71 or greater. You can get further information on the Shell.Application in my article that appeared in the July, 2000 edition of the VFUG (www.vfug.org) newsletter.

If the Shell.Application isn't available to you (and it can be difficult to install), a similar script could be used utilizing the Scripting.FileSystemObject. Ed Rauh and I are writing a series on the Windows Script Host, of which this is a part. The series is also available on the VFUG site. The most recent article concerns itself with the Scripting.FileSystemObject. The series began in September with an overview.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform