当我使用robocopy复制文件并使用选项/ IS覆盖如果已经存在于目的地.它将选项视为日志可以看到的另一个文件:错误:参数#4无效:“C:/ Program Files /
Git / IS”
任何人都知道如何在覆盖目的地的文件时复制Windows中的文件.
$robocopy "Z:\ubuntushare" "C:\Natlink\Natlink\MacroSystem" "_git.py" /IS ROBOCOPY :: Robust File Copy for Windows Started : Sat Sep 17 18:00:05 2016 Source - Z:\ubuntushare\ Dest - C:\Natlink\Natlink\MacroSystem\ Files : _git.py Options : /COPY:DAT /R:1000000 /W:30 ------------------------------------------------------------------------------ ERROR : Invalid Parameter #4 : "C:/Program Files/Git/IS" Simple Usage :: ROBOCOPY source destination /MIR source :: Source Directory (drive:\path or \\server\share\path). destination :: Destination Dir (drive:\path or \\server\share\path). /MIR :: Mirror a complete directory tree. For more usage information run ROBOCOPY /? **** /MIR can DELETE files as well as copy them ! pri@pri-PC MINGW64 /c/NatLink/NatLink/MacroSystem
解决方法
编辑2016/09/19 – 经过测试,确实有效
An argument starting with 2 or more / is considered an escaped Windows
style switch and will be passed with the leading / removed and all \
changed to /.
- Except that if there is a / following the leading block of /,the argument is considered to be a UNC path and the leading / is not
removed.
注意:这只是完整列表的一小部分.在Windows中使用git bash shell时,最好阅读完整列表
因此,在这种情况下,解决方案是将交换机中的正斜杠加倍
robocopy "Z:\ubuntushare" "C:\Natlink\Natlink\MacroSystem" "_git.py" //IS