2

在 Windows 批处理中我会做

xcopy source_spec target_spec /d/u/r/y

/d : more recent
/u : only those that exist in target
/r : ignore the read only flag
/y : don't prompt for overwrite

使用等效的 powershell copy-item/copy cmdlet 最简单的是什么。

和 wags -是的,我知道我可以在 powershell 中做 xcopy :-)

所以在powershell中我这样做:

cmd /c xcopy source_spec target_spec /d/u/r/y
4

1 回答 1

5

不,不写几行脚本就没有直接的等价物。使用 xcopy 或 robocopy。

于 2011-09-10T15:04:24.090 回答