3

I am using the xcopy command like this -

xcopy  /y/i/e/f \oldLocation \newLocation

and i get output like this:

D:\temp\src\a.txt-> C:\Temp\a.txt

I need the xcopy to give me the complete path for just the destination files (only C:\Temp\a.txt) , after copy has succeeded. I have already tried /l flag too and it gives output like -

D:a.txt

Is there a way to do this? Or do I have to manually extract the destination paths.

  • try switch /q/l. Though it will not fulfill your requirement but it will be close to it. – PM. Nov 21 '13 at 13:22
  • /q/l is displaying the number of files copied and no file names. I want the output to show the destination path of files copied – user3017635 Nov 21 '13 at 13:29

1 Answers1

0

Why not use Powershell instead?

$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
}
Vasili Syrakis
  • 9,321
  • 1
  • 39
  • 56