Link to home
Start Free TrialLog in
Avatar of dgmoore1
dgmoore1Flag for United States of America

asked on

SharePoint/VBA - copy folder contents to folders on a non-Sharepoint server

I need to write a procedure in Access to copy the contents of two folders on a SharePoint server to folders on a non-Sharepoint network server. Can anybody point me in the right direction?
ASKER CERTIFIED SOLUTION
Avatar of quihong
quihong
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgmoore1

ASKER

Are you saying I can just do something like

FileCopy "\\Servername\sites\sitename\doclibname\foldername\*.*", "DestinationServer\DestinationFolder\*.*"

?

Does the Web Client service need to be running on the workstation where the code is executing, or on the server where the files reside?

Unless I'm missing something I don't see how this could work - could you provide a little more detail?

Thanks
I am not sure about the specific MS Access "FileCopy" command, but lets assume you are writing a simple command line (batch file).

It would be like this:
copy \\servername\sites\sitename\doclibname\foldername\*.* \\destinationserver\folder

The Web Client service needs to be running from the workstation (default on workstation OS) where the code is executing.

I hope that clears things up.
OK - I have never had much luck interacting programmatically with Sharepoint folders without using XMLHTTP. I'll give this a try tomorrow @ work and see if I can get it to work.

Thanks
How would I pass my credentials to Sharepoint for authentication?
By default it will use whatever account is currently logged on as.
The servers in question are in different domains; each requires authentication before access is granted for any transaction. Each file action (read/write) request must be accompanied by valid credentials. I don't see how credentials can be passed programmatically in the scenario you suggest.
Nobody will be logged on to either server when a transaction is initiated by the proposed process.
Whatever is executing your process/transaction needs to authenticate to the SP doclib and network share. The process has to run under a credential even if its local machine, in which case you might need to add a runas command.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great, however did I not provide guidance that pointed you in the right direction? Btw, you don't need to use webdrive to map a folder to sharepoint. It could have been done with a net use command.
Your suggestions were helpful, and I did award you the points. WebDrive is a lot easier, however. Thanks
No points awarded
This is odd. I awarded the points earlier this morning and the page reloaded showing my answer as accepted, with 500 points awarded to you and 0 points to me. I'll try it again and see if it sticks this time.
Take a look at the Close Request Pending box at the top. Hopefully it is now correct - it's exactly what I got when I submitted earlier today