Need to write a bat file to copy files

Posted on 2006-06-22
Last Modified: 2010-04-17
We have 20 guys that travel in vans all day.  On their laptops intheir vans, we monthly copy 3 gb worth of data to their local laptop.  The data and path on the laptop looks like this:

c:\Folder A
c:\Folder B

Inhouse, during the month, we may modify file2 in Folder A and add a file to Folder B.  At the end of the month, the folder / file network drive structure will look like:

H:\Folder A
----file1 (file has been modified)
H:\Folder B
----file4 (new file)

We would like to equip each van with a wireless 802.11g card and setup our parking garage as a hotspot.  This way, each day when they pulled into our garage, they would connect to our LAN.  They could then somehow run this bat file to get the most recent data from out server.  Since this folder structure will eventually be close to 5 GB, we do not want to copy everything.  Just added or modified items.  Is there a simple bat file that I could put in place to accomplish this?

Thanks in advance..
Question by:chadd25
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 13

Accepted Solution

rhickmott earned 125 total points
ID: 16960311
We have a similar setup on our server for backup purposes however it is written in PHP.

Im not sure what programming languages you know but a lot of them as long as you can create command line programs or execute from the command line can be run just as easily as batch files. You then have a lot better control over automation.

Its been years since ive looked at Batch processing but its changed a lot in WIN NT X but you will need to look at what criteria to see if a file has been changed.

The most simple would be to look at when it was last modified and if its newer then copy it over. You can use Windows Scheduled Tasks to execute a program or command at a certain time if you leave them on constantly or as I mentioned if you use a programming language you can write a client which will look for a connection to a master every 15 minutes and start once it detects it.
LVL 16

Assisted Solution

alain34 earned 125 total points
ID: 16960435
I think you are better off to try to install a folder synchronisation folder on each laptop.
This way, we the van are in the garage, they connect to the network and the folder on your server get synchronised with the folder on each laptop.
This way, you don't need to code anything

allwaysync can do thsi kind of things.
You can also look here
LVL 10

Assisted Solution

fostejo earned 125 total points
ID: 16963397

I'd suggest something like RoboCopy, one of the Microsoft Resource Kit tools, available at

RoboCopy could be called from an extremely simple VBScript or batch file - it's a very, very good utility and can intelligently synchronize - rather than blindly re-copying files - It's very fast, has built-in logging, bandwidth throttling etc. etc. etc.


Assisted Solution

yotamsher earned 125 total points
ID: 16987126
I think windows xcopy will do the job:
something like:
xcopy h:\ c:\ /e /d /h /y

these flags do the following:
/d makes coping newer files only
/y avoids prompting
/e is in charge of directory structure
/h in case you want hidden and system files

I hope this helps you

Expert Comment

ID: 17067467
one last comment, just got into something called SyncToy

It is part of Microsoft Power toys, and supposed to synchronize folders, like you wish


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question