问题
I'm trying to write a robocopy command to copy files from my local computer to any one of my deployment servers
ROBOCOPY ../../MyService/bin/release/ \\remote-computer\\C:\services\myservice /MIR
and I get this error
The system detected a possible attempt to compromise security.
Please ensure that you can contact the server that authenticated you.
This is expected as I haven't included any sort of security credentials in the command.
Is there a way to get this to work by including permissions? I don't want to have to do this by sharing folders and stuff like that. I've looked but I can't see anything in the documentation.
Should I do this with something like psexec
? Or perhaps I should be using something like powershell instead?
回答1:
Can you please take a look at this answer to see if this answers your question: Robocopy commands to copy a file to over 50 remote machines. Also, please take a look at this KB article: http://support.microsoft.com/kb/938457.
回答2:
When accessing file paths on remote machines you need to reference the drive letter as a hidden share instead of just with a colon
I.e. C drive is on the remote machine becomes \remoteserver\C$\Filepath
回答3:
I got this for the first time after my VPN connection to a remote driver (H:) timed out. I restored VPN connection, but still got this robocopy error.
I fixed this for me by just using Windows File Explorer and clicking my H: drive. It refreshed, and I retried my robocopy batch file script and all went well.
(thumbs up)
来源:https://stackoverflow.com/questions/19234471/robocopy-to-copy-files-to-a-remote-machine