Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FileSystemObject - CopyFolder
Message
From
07/10/2004 16:30:49
 
 
To
07/10/2004 15:48:46
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00949696
Message ID:
00949710
Views:
9
After some more research I found that you can't use UNC paths with filesystemobject. http://www.15seconds.com/Issue/990429.htm says that "The FileSystemObject will not accept a virtual path and cannot obtain the network access necessary to resolve a UNC name."

Thats OK, I'll just have to move my PRG over to that computer.

>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
Previous
Reply
Map
View

Click here to load this message in the networking platform