Simple task:
Move all the content of the directory c:\Users\files\Desktop\test 2
to c:\Users\files\Desktop\test 1
C:\admin\temp>robocopy "c:\Users\files\Desktop\test 2" "c:\Users\files\Desktop\test" *.* /S /MOVE
Sounds reasonable, but now, the directory c:\Users\files\Desktop\test 2
gets removed too. Is there a switch to just move the CONTENT without the removing directory itself?
Best Answer
I have been trying to do the same from a network share.
Here are my findings and solution from tests on a Windows 7 machine.
Suggestion:
Problem: Moves source folder.
Suggestion:
Problem: Still moves source folder.
Suggestion:
Problem: Leaves empty folder structure behind in source folder.
Working solution:
First two lines move top level files, the third moves folders. Note the double %% is for usage in a batch file, pasting into a command line needs these changed to a single percentage mark.
~nxi in the destination is a FOR SUBSTITUTION VARIABLE ( See FOR /? ) where ~nxi represents the name and extension of the item currently being looped through.
Robocopy defaults to RETRY A MILLION times and WAIT 30 SECONDS between each try, so you may wish to add /R:1 /W:1 to the robocopy arguments.