问题
I'm trying to copy a local file onto a server using robocopy. This is my script:
if exist \\10.1.1.1\c$ net use \\10.1.1.1\c$ /delete
net use Z: \\10.1.1.1\c$ p@ssword /user:domain\username
:: first copy files to a temp directory
xcopy C:\dev\Filepath C:\dev\TempFiles\ /E /C /H /R /K /O /Y
:: then copy files from temp directory to server
robocopy "C:\dev\TempFiles" "Z:\Program Files (x86)\Insite Software\Commerce Integration Service V3.7.1.16264" MSD*.dll
net use \\10.1.1.1\c$ /delete
I realized that it's not working because the file I'm trying to replace on the server is currently in use on the server. How do I replace a file that's currently in use?
来源:https://stackoverflow.com/questions/33112307/robocopy-error-32-file-im-trying-to-update-replace-is-being-used-by-another-pro