Windows – xcopy: move files instead of copy

windows 7xcopy

I would like to use xcopy to move, not copy files across a network with the Verify flag. I could not find a switch on xcopy to move files, is there an xmove I can use that has verify?

At the moment I am using xcopy /D /V but need to get rid of the files at the source only when it is verified a file was successfully copied to the destination.

Best Answer

You should check out robocopy, it is much more powerful than xcopy. You can easily move files with /MOV or /MOVE.

To move files only (delete from source after copying)

robocopy from_folder to_folder files_to_copy /MOV

To move files and directories (delete from source after copying)

robocopy from_folder to_folder files_to_copy /MOVE

http://ss64.com/nt/robocopy.html

Related Question