scheduled batch copy

Status
Not open for further replies.

Spike

Posts: 2,122   +0
I've never done this before so I thought I'd ask.

At a certain time every day, I want a computer to copy the contents of one directory (a network share as it happens) to another specified directory (not a network share).

I am considering doing this by running a batch file in the task scheduler, and one thing comes to mind...

could anybody tell me if there is a way of copying this folder to another location on the same hard drive, through a batch script, suppressing all warnings? Apart from the fact that I want this to happen in the background, I don't want it stopping to ask if it's ok to overwrite existing files for example.
 
Make a batchfile, e.g. dailycopy.bat in which you just use the copy command.
Go into a CMD-box and type in copy /? which shows you all the parameters you need.
If you want to see WHAT was copied as well, you can have the results in a textfile.
e.g. copy /Y c:\test\*.* c:\otherdir >dailycopy.txt
 
lol. By rights that should teach me to acctually reseach the things I'm thinking about before asking about them - I was very tired though.

Thanks RBS - much appreciated.
 
This is my batch file I created for something similar


echo off
:: variables
set drive=j:\
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents" "%drive%"

:: use below syntax to backup other directories...
:: %backupcmd% "...source directory..." "%drive%\...destination dir..."

echo Backup Complete!
@pause
 
Status
Not open for further replies.
Back