Question : How do i use Robocopy to create new folders

Hi,

I have a client that need certain files backed up periodically (every week lets say), the backup is to be done locally and automatically using a batch file. I am used to using robocopy but i need to know (if its even possible) how to create a new folder each time it is run.
For instance, if the source is "C:\important files" and the destination is "C:\Important Backup" i need the batch file to create a new (timestamped if possible) folder in the destination, so you would have the actual files going into "C:\Important Backup\07-07-2010" or something to that degree.
can robocopy do that? if not, can Xcopy do it? if not, WHAT CAN??

thanks.

Answer : How do i use Robocopy to create new folders

Try the script below; it will currently only echo out a robocopy command (which you can of course adjust to your likings).
If the time stamp doesn't get created correctly, please post the output of
echo %date%
in a command prompt.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
@echo off
setlocal
for /f "tokens=1-3 delims=/" %%a in ("%Date%") do (
  set mm=%%a
  set dd=%%b
  set yy=%%c
)
set TimeStamp=%yy%-%mm%-%dd%
set Source=C:\Important Files
set Target=C:\Important Backup\%TimeStamp%
ECHO robocopy "%Source%" "%Target%" *.* /e /r:0 /tee /nfl /ndl /np /log+:"%~dpn0-%timestamp%.log"
Random Solutions  
 
programming4us programming4us