我正在使用像这样的xcopy命令 -
xcopy /y/i/e/f \oldLocation \newLocation
我得到这样的输出:
D:\temp\src\a.txt-> C:\Temp\a.txt
复制成功后,我需要xcopy为目标文件(仅C:\Temp\a.txt
)提供完整路径。我已经尝试了/ l标志,它给出了输出 -
D:a.txt
有办法做到这一点吗?或者我是否必须手动提取目标路径。
答案 0 :(得分:0)
为什么不使用Powershell?
$oldLocation = "C:\OldFolder\"
$newLocation = "D:\NewFolder\"
ForEach ($item in (gci $oldLocation)) {
Write-Host $newLocation$item # Tells you what is being copied
Copy-Item $item.fullname $newLocation$item
}