I need a batch file to backup 5 shared drives and send that to a 6th drive creating a date named folder with the contents of the other drives all within this folder.
Drives: J, K, L ,M ,N and the Backup drive is S.
It's been a long time since I've had to make batch files and have done some quick testing that looks like it will work.
I want all files including empty folders and hidden files to copy into the newly created backup folder.
What parameters should I be using for "xcopy" to accomplish this task? I read that Win 7 upgraded parameters with xcopy. I will be running the batch file on a Win 8.1 system.
TIA xcopy guru's.
Add what I'm working on currently:
@echo off
::variables
set backupcmd=xcopy /s /c /d /e /h /i /r /y
set dirname="%date:~10,4%_%date:~4,2%_%date:~7,2%_backup"
mkdir S:\%dirname%
echo ### Backing up drive1 Documents...
%backupcmd% "J:\*.*" "S:\%dirname%\drive1"
echo ### Backing up drive2 Documents...
%backupcmd% "K:\*.*" "S:\%dirname%\drive2"
echo ### Backing up drive3 Documents...
%backupcmd% "L:\*.*" "S:\%dirname%\drive3"
echo ### Backing up drive4 Documents...
%backupcmd% "M:\*.*" "S:\%dirname%\drive4"
echo ### Backing up drive5 Documents...
%backupcmd% "N:\*.*" "S:\%dirname%\drive5"
echo Backup Complete!
@pause