• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1499
  • Last Modified:

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?
0
dgmoore1
Asked:
dgmoore1
  • 9
  • 6
2 Solutions
 
quihongCommented:
You can access the SharePoint Document Library folder by using the UNC Path. For example, \\servername\sites\sitename\doclibname\foldername.

Accessing SharePoint Documents Libraries by UNC path requires the "Web Client" Windows Services to be running. It is running by default on XP/Vista/Win7 but is disabled on Server OSes.
0
 
dgmoore1Author Commented:
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
0
 
quihongCommented:
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dgmoore1Author Commented:
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
0
 
dgmoore1Author Commented:
How would I pass my credentials to Sharepoint for authentication?
0
 
quihongCommented:
By default it will use whatever account is currently logged on as.
0
 
dgmoore1Author Commented:
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.
0
 
dgmoore1Author Commented:
Nobody will be logged on to either server when a transaction is initiated by the proposed process.
0
 
quihongCommented:
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.
0
 
dgmoore1Author Commented:
I found a simpler solution - the WebDrive (www.webdrive.com) client allows you to map a network drive letter seamlessly to a Sharepoint (or WebDAV, FTP, etc) folder, including storing credentials, and then to interact with the mapped drive letter as with any other drive.

I downloaded and installed the trial, set up a connection in about 10 seconds, wrote a line of code "FileSystemObject.CopyFile "H:\*.*", "c:\[foldername]\", launched it, and it works perfectly. I can also set the job up to run as a scheduled task using WebDrive's File Transfer Manager.

Thanks for your input in any case.
0
 
quihongCommented:
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.
0
 
dgmoore1Author Commented:
Your suggestions were helpful, and I did award you the points. WebDrive is a lot easier, however. Thanks
0
 
quihongCommented:
No points awarded
0
 
dgmoore1Author Commented:
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.
0
 
dgmoore1Author Commented:
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
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 9
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now