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 have a box running an SFTP server to which users are uploading directories full of files. The upload directory is acecssible on the UNC share \\ServerA\Documents\Uploads.

I am trying to write a script that will move and subfolder it finds in this share over to a share on another server. We can call that share \\ServerB\Processing\.

I can use Windows Explorer to successfully move a directory from \\ServerA\Documents\Uploads to \\ServerB\Processing\ howwever, if I open a command prompt and issue the command

move \\ServerA\Documents\Uploads\targetfolder \\ServerB\Processing\targetfolder

I receive an access denied error. Why would my permissions be different between Windows Explorer and the command line? How can I trouble shoot this?

share|improve this question

4 Answers 4

up vote 1 down vote accepted

Interesting problem. The next step I'd do is to see if copy and xcopy of the data also returns an error. A short little move-like script could be useful here:

xcopy \\ServerA\Documents\Uploads\TargetFolder \\ServerB\Processing\DestFolder /s/e/h
rmdir \\ServerA\Documents\Uploads\TargetFolder /s /q

The results of that could be diagnostic. If this works but move doesn't, the problem may exist in how 'move' fundamentally handles the copy-delete process.

share|improve this answer
    
This doesn't really answer the why of the problem, but it does work! –  Justin Walgran Jun 18 '09 at 19:26

I think you really have some permission issues in that case. Try to run "cmd" under higher privileged user and see if the command goes right now. Also, if you schedule your command as a task, you must run it under some domain user, who has access to both source and target servers, otherwise it would be processed under local system account, which doesn't have any network permissions.

share|improve this answer

I think that you have a permission problem as well. First I would move the contents of the upload folder to a local folder on the system and see if that works. If not then you have found the source of your problem. Then I would try moving the contents of your local folder to your destination folder. Which ever system fails will be your problem.

Make sure you cut and paste the UNC from the working script to your final script (typo's are annoying debug problems)

share|improve this answer

Use robocopy.exe available here

example:

robocopy \\server1\c$\sourcedir \\server2\backup\server1 /MIR
share|improve this answer

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.