Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CopyFiles
Message
From
13/02/2003 09:47:47
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
CopyFiles
Miscellaneous
Thread ID:
00752663
Message ID:
00752663
Views:
50
I am trying to copy files from one directory to antoher using the 'CopyFile' command of Windows Scripting Host. Below is the code I am using:

lcPath = 'P:\NewSales'
lcExtendedPath = lcPath + '\Unzipped_files\NewSales'

oFSO = CREATEOBJECT('Scripting.FileSystemObject')
oFolder = oFSO.GetFolder(lcExtendedPath)

FOR EACH oFile IN oFolder.Files
oFSO.CopyFile(lcExtendedPath+'\'+oFile.Name,lcPath+'\'+oFile.Name,.T.)
NEXT oFile

I keep getting the following error when I run this:

'OLE Error Code 0x800a0046: Unknown COM Status Code'

However, if I place a 'Wait lcExtended+oFile.Name Window' command prior to the 'CopyFile' command everything works fine. What am I missing?

Thanks in advance,
Russell
Next
Reply
Map
View

Click here to load this message in the networking platform