[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 402
  • Last Modified:

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
0
HPvH
Asked:
HPvH
1 Solution
 
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now