# Using CMD to move directory contents



## Sandor (Jul 28, 2008)

```
C:\>move C:\dir1\*.* C:\dir2
```
With this example you can move the files from dir1 to dir2. The problem is that with my first dir I have subdir's to. I want to be able to move my subdir contents as well. How do I do this?

ie i want dir2 to be a a splitting image of dir1


----------



## zpgm (Mar 18, 2009)

you can use robocopy which can be found in the "Windows Resource Kit Tools":
http://www.microsoft.com/downloads/...69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

I use it to backup a very large folder (several GB) with a script that looks like this:

```
@echo off
cd C:\Program Files\Windows Resource Kits\Tools
robocopy [I]origin_path [/I][I]destination_path[/I] /SEC /MIR /V /TS /LOG+:f:\Scripts\DCC_Backup_logfile.txt
@echo off
PAUSE
```
the "/something" triggers I use compares the content of the origin_path and destination_path and replaces those which have been modified.


----------

