Copy only the new files with a bat file

Hi,

I need a bat file who will copy only the new files and directories from C:\Project to f:\Backup
After that it should delete all *.bak files from f:\Backup

Thanks,
HP
HPvHAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

djMundyCommented:
Hi HPvH,

Check out rsync (in the WIndows Server 2003 Resource Kit Tools, a free download from microsoft.com).

Cheers,
Daniel
0
HPvHAuthor Commented:
I know that one, but I have to give the bat file to some clients.
0
snagsy1980Commented:
use a VBScript, there is a good example here http://www.mssqltips.com/tip.asp?tip=1324
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

HPvHAuthor Commented:
Cant I do it with a xcopy and name the file backup.bat
0
snagsy1980Commented:
0
XionathCommented:
Something like this

--------------------

@echo off
XCOPY C:\PROJECT\*.* F:\BACKUP /D /S
F:\
CD BACKUP
DEL *.BAK /Q

------------------
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HPvHAuthor Commented:
xionath,
your code works, the only thing is that it asks to overwrite when a file is newer. It should not ask any thing.
0
HPvHAuthor Commented:
I did it with /Y
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.