在 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