>>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,
It gives me an error message: ActiveX component can't create object 'Shell.Application' :( How can I install Shell Application on my machine?
Sorry for these questions.
Thanks in advance.
If it's not broken, fix it until it is.
My Blog