简体   繁体   English

CMD命令(XCOPY,MOVE,ROBOCOPY)在Windows OS中复制“剪切和粘贴”(pref。7)

[英]CMD command (XCOPY,MOVE,ROBOCOPY) to Replicate “CUT and PASTE” in Windows OS (pref. 7)

our Users has a Manual process that CUTS and PASTE files from one SHARED folder to another SHARED Folder over the network. 我们的用户有一个手动过程,可以通过网络将一个共享文件夹中的文件剪切和粘贴到另一个共享文件夹中。 The manual process has no problem except that it can be done automatically by means of a Batch CMD coding. 手动过程没有问题,除了可以通过批处理CMD编码自动完成。 Now I was tasked to do this but I failed in some way due to several requirements: 现在,我被要求执行此操作,但是由于一些要求,我以某种方式失败了:

  1. The File Ownership (OWNER) remains 保留文件所有权(OWNER)
  2. The Time Stamp is retained 时间戳被保留

What I did so far: 到目前为止,我做了什么:

xcopy "\\sharedpc\folderA\*.CSV" "\\sharedpc\folderB\" /O
robocopy "\\sharedpc\folderA" "\\sharedpc\folderB" *.csv /COPY:DO
robocopy "\\sharedpc\folderA" "\\sharedpc\folderB" *.csv /COPY:DTO

I am getting access denied from these commands when I run them (ELEVATED Already). 当我运行这些命令时,它们被拒绝访问(已升级)。

I am guessing that the either folderA or folderB or the share permissions is strictly set to read/write without the Special Permissions, because I can easily do these commands without access denied on my PUBLIC Shared Folder. 我猜想folderA或folderB或共享权限都严格设置为读/写而没有特殊权限,因为我可以轻松地执行这些命令而不会拒绝PUBLIC共享文件夹上的访问。

What cannot be done: 无法完成的工作:

  1. Grant Special Permission for those folders for Users 为用户授予这些文件夹的特殊权限

The weirdest part is, they can do CUT and PASTE but cannot run my batch command properly with Elevated Permissions. 最奇怪的部分是,他们可以执行CUT和PASTE,但不能使用“提升的权限”正确运行我的批处理命令。

My question is, How can I replicate the CUT and PASTE using Batch CMD? 我的问题是, 如何使用批处理CMD复制CUT和PASTE?

您可以通过使用确实具有权限的凭据将驱动器号映射到共享来解决此问题,但是您必须提供凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM