Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FileSystemObject - CopyFolder
Message
From
07/10/2004 15:48:46
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
FileSystemObject - CopyFolder
Miscellaneous
Thread ID:
00949696
Message ID:
00949696
Views:
71
Hi,

I'm trying to use the CopyFolder method from the FileSystemObject. I want to back up some directories (and all their contents). Since VFP 7 doesn't have an easy way to do this I decided to try to use the FileSystemObject.

I think the reason why I'm having problems is because I'm trying to copy directories on another computer on our network.

Just to make sure I could get it to work I tried:
loFs = CREATEOBJECT("Scripting.FileSystemObject")
loFs.CopyFolder("c:\ctemp", "c:\ctemp2")
And it worked. But when I tried the following:
lcFrom = "\\webtest\D\webclnt\"
lcTo = "\\webtest\D\WebClntBakOct72004\"

loFs = CREATEOBJECT("Scripting.FileSystemObject")

SCAN
  lcClnt = ALLTRIM(Iwc_ID)
  lcClntWD = lcFrom + lcClnt + "\IMIRMWeb\IMWebDocs\"
  lcClntCSS = lcFrom + "html\" + lcClnt + "\images\"
  lcClntBak = lcTo + lcClnt + "\"
  
  IF DIRECTORY(lcClntWD)
    MD &lcClntBak  
    
    MESSAGEBOX(DIRECTORY(lcClntWD))  && both messageboxes message ".T."
    MESSAGEBOX(DIRECTORY(lcClntBak))
        
    loFs.CopyFolder(lcClntWD, lcClntBak)    
  ENDIF 
    
  EXIT && temporary, I just want to run it on the first one until it works
ENDSCAN 
it failed. I get the error "OLE Error code 0x800a004c: Unknown COM Status Code." With CopyFolder can you use paths like "\\webtest\D\webclnt\"? Or does it have to be mapped? Any other way to do this?

Thanks,
Chris
Next
Reply
Map
View

Click here to load this message in the networking platform