I am looking for a way to move all files and subfolders within a given directory to somewhere else and after the movement delete the original folder. For example, suppose in current path, there is a folder called FOLDERA, I am trying to move all files and subfolders from FOLDERA to the current path and then remove FOLDERA, but I need to do this with a command line. I try MOVE command but I find that it can only move the files. Anyway to do that? Thanks.

migrated from stackoverflow.com Sep 24 '12 at 8:08

This question came from our site for professional and enthusiast programmers.

del /s *.* should do the work in windows 7 

On Windows Vista or later, look at robocopy

NOTE: This question is off topic for Stack Overflow; Server Fault or Super User would likely be a better fit.

Robocopy <src> <dest> /MOVE

will move the files and delete the original directories.

There are several other options that you may wish to use to control overwriting etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.