Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying one drive content to another - Urgent
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00421167
Message ID:
00421189
Views:
16
>Hi everyone and especially George & Ed!
>
>I have to quickly copy one drive content to another, except for BackUp directories. How can I do it the simpest way (not neccessary from VFP)?
>
>The code sample would be much appreciated, because it's really urgent.
>
>Thanks a lot in advance.

Nadya,

I backup my local work out to the server every morning using the following VBScript file. It requires the Shell.Application being installed.
' Backup.vbs

Const FOF_NOCONFORMMKDIR = &H200
Const FOF_NOCONFIRMATION = &H010
Const FOF_SIMPLEPROGRESS = &H100
Dim cSource, cTarget, oShell, oFolder
cSource = "C:\Program Files\Microsoft Visual Studio\VFP98\Ida"
cTarget = "F:\Shawdev\Ida"
Set oShell = CreateObject("Shell.Application")
Set oFolder = oShell.Namespace("F:\Shawdev\VFP98")
oFolder.CopyHere cSource, FOF_NOCONFORMMKDIR + FOF_NOCONFIRMATION + FOF_SIMPLEPROGRESS
cSource = "D:\FPW26\Launch"
cTarget = "F:\Shawdev\Launch"
oFolder.CopyHere cSource, FOF_NOCONFORMMKDIR + FOF_NOCONFIRMATION + FOF_SIMPLEPROGRESS
You could just use the CopyFolder method from the Scripting.FileSystemObject. I prefer using the Shell.Application because it lets me know the progress.

Selecting the individual directories to copy, however complicates things. I'd simply copy everything and then delete what I didn't want. It's less complex since otherwise you'd have to recurse the diretory tree, building the necessary directories and copying files as required.
George

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

Click here to load this message in the networking platform