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?

4 Answers 4


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.

  • This doesn't really answer the why of the problem, but it does work! Jun 18, 2009 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.


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)


Use robocopy.exe available here


robocopy \\server1\c$\sourcedir \\server2\backup\server1 /MIR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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