Robocopy 过滤器不起作用?
您好,我正在尝试使用 robocopy 通过网络将单个文件从我的计算机复制到另一台计算机。我要复制的文件名为 setup.exe,它所在的目录也有一个名为“setup”的目录。我只想复制可执行文件,因此我尝试在列出文件名的末尾对 robocopy 命令应用过滤器。然而,尽管有过滤器,它最终还是复制了可执行文件和目录。显然 robocopy 会忽略文件扩展名???
这是我的 robocopy 命令的格式:
robocopy c:\users\ben\desktop /E /Z \\BensRemote\c$\temp setup.exe
因此最后的过滤器应该防止安装目录也被复制但事实并非如此。我做错了什么?是 /E 参数吗???
Hi I'm trying to use robocopy to copy a single file from my computer to another computer over the network. The file I'm going to copy is named setup.exe and the directory it rests in also has a directory called "setup". I only want to copy over the executable, so I tried applying a filter to the robocopy command at the end listing the filename. However, despite the filter, it ends up copying both the executable AND the directory. Apprently robocopy ignores the file extension???
Here is the format of my robocopy command:
robocopy c:\users\ben\desktop /E /Z \\BensRemote\c$\temp setup.exe
so the filter at the end should be preventing the setup directory from also being copied over but it isn't. What am I doing wrong? Is it the /E argument???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
/E 参数是导致问题的原因。
The /E argument is what causes the problem.
删除 /E。
/E 将复制子目录,包括空目录。您正在应用的过滤器“setup.exe”仅引用文件,而不引用文件夹。
Drop the /E.
/E will copy over subdirectories, including empty ones. The filter you're applying, 'setup.exe', only refers to files, not folders.