Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to copy a file from a Windows 2003 server to a WebDAV folder (on the same server, if it matters). This operation will be performed via a batch script executed via Scheduled Tasks. I've enabled the WebClient service on the server.

So far I've determined that I can do it like this:

net use x: http://host/path
copy c:\path\myfile.txt x:
net use x: /delete

1) Is there a simpler way than creating a temporary mapped drive? Will it work via a batch file when no user is logged in?

2) Is there anything I should know about enabling the WebClient service on my server? Previously it was disabled, which I assume is default.

share|improve this question
    
Nothing simpler without using 3rd party software. User doesn't have to be logged in; but the batch file will run as a user, that user will get the mappings... –  Chris S Aug 4 '11 at 15:02
1  
In your question you state that the WebDAV folder is on the same server, but in response to my answer, you say that it is a different server. Please pick one and clarify. –  gWaldo Sep 14 '11 at 12:13
add comment

3 Answers

You might try using pushd and popd, which help automate the mounting of the drive some. You also might try using PowerShell, if possible.

share|improve this answer
add comment

Why, oh why, (if it's on the same server) don't you copy from local folder to local folder?

copy c:\path\myfile.txt c:\path\to\www-root\subdir\destination\

You may need to restart IIS/Apache (or whatever) after the file is copied, but most likely not.

share|improve this answer
    
It's not on the same server, of course. –  Boden Sep 6 '11 at 3:15
    
Don't you specify that it is in the same server in the original post? –  gWaldo Sep 6 '11 at 15:03
    
If they are different servers in the same LAN, you can just do a normal net use x: \\server\share and then copy. –  gWaldo Sep 6 '11 at 15:06
    
@gWaldo, you're assuming the WebDav is just serving a file directory. I know SharePoint in particular allows you to mount Sites as WebDav folders, but it's all stored in the DB. This might be something similar. –  Chris S May 28 '12 at 14:42
add comment

DavCopy is a command line tool to push files to WebDAV. It supports command line authentication for batch jobs, so it can run when you're not logged in.

The webclient service isn't needed to run the tool.

It uses simple syntax, too. similar to robocopy.syntax!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.