19

Just need a batch script that will move one folder and all its contents into another folder.

Essentially this

C:\Folder1 to C:\Folder2\Folder 1

user3108250
  • 191
  • 1
  • 1
  • 3
  • 3
    I believe that this was already answered here: http://stackoverflow.com/questions/3470880/move-folder-from-one-directory-to-another-in-batch-script – John Lamontagne Dec 16 '13 at 17:31

1 Answers1

26

You can use windows native command:

MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

You can use move /? call for more details.

So, in you case , the command would be:

move C:\Folder1 C:\Folder2\

If Folder2 doesn't exist, Folder1 will be renamed Folder2.

Community
  • 1
  • 1
mihai_mandis
  • 1,578
  • 1
  • 10
  • 13
  • 4
    If C:\Folder2 already exists, Folder1 will be moved into Folder2: C:\Folder2\Folder1. If it does not, Folder1 is renamed Folder2. – Joe Marfice Jun 04 '19 at 13:57
  • 2
    Note: For copying a directory from one drive to another, `robocopy dirname1 dirname2 /E /MOVE` has to be used instead (as `move` will give out a nondescript `access denied` error) – YellowAfterlife Jan 10 '21 at 12:34