Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scripting File Copy Error
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Scripting File Copy Error
Miscellaneous
Thread ID:
00951028
Message ID:
00951028
Views:
59
I'm trying to copy the contents of one folder to all of the subfolders of another folder. The following code works fine if the files I am copying do not exist in the destination directory. If the files do exist then I get the error 'invalid com status code'. I thought the last parameter of the copy function would automatically overwrite the files if they exist but I guess I am wrong. Is there anyone else out there who has had the same problem? Thanks for any help.
fso = CREATEOBJECT("Scripting.FileSystemObject")
flFrom = fso.getfolder(m.FromCopy)
flTo = fso.getfolder(m.ToCopy)
subcount = flto.subfolders.count
FOR EACH oFolder IN flto.subfolders
	*WAIT WINDOW 'Copying to: ' + ALLTRIM(oFolder.path) nowait
         flfrom.copy(oFolder.path,.T.)
endfor
Kendall Dixon
Data Integration Programmer
Tusculum College
Greeneville, TN 37743
423.329.5353
Next
Reply
Map
View

Click here to load this message in the networking platform