复制项目与目的地的问题

发布于 2024-09-28 06:45:59 字数 461 浏览 0 评论 0原文

我有两个复制项目命令

  1. Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse

  2. 复制项 "C:\Test\folder2" "\\remote_machine\destination" -Recurse

folder1 和folder2 包含文件夹和文件

这两个命令类似,但得到不同的结果

  1. 复制folder1 的内容到目的地 - 确定
  2. 将文件夹2及其所有内容复制到目的地 - \remote_machine\destination\folder2 - 失败

更新:我没有收到任何错误。问题是关于第二个文件夹的路径。我希望两个文件夹的内容都位于一个目标文件夹中。

I have two Copy-Item commands

  1. Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse

  2. Copy-Item "C:\Test\folder2" "\\remote_machine\destination" -Recurse

folder1 and folder2 contain folders and files

Both commands are similar, but I get different results

  1. Copy content of folder1 to destination - OK
  2. Copy folder2 with all content to destination - \remote_machine\destination\folder2 - FAIL

UPDATE: I don't get any error. Problem is about path to second folder. I want content of both folders in one destination folder.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽容 2024-10-05 06:45:59

PowerShell 存在问题 - http://groups.google。 com/group/microsoft.public.windows.powershell/browse_frm/thread/ae9b8b4424c2af22

我的示例的解决方案是

  1. Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse< /code>
  2. 复制项“C:\Test\folder2\*”“\\remote_machine\destination”-Recurse

It's problem with PowerShell - http://groups.google.com/group/microsoft.public.windows.powershell/browse_frm/thread/ae9b8b4424c2af22

Solution for my examples is

  1. Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse
  2. Copy-Item "C:\Test\folder2\*" "\\remote_machine\destination" -Recurse
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文