Need to write a bat file to copy files

Posted on 2006-06-22
Medium Priority
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
LVL 13

Accepted Solution

Robin Hickmott earned 500 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 500 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 http://www.experts-exchange.com/Storage/Q_21276679.html?query=allwaysync&clearTAFilter=true
LVL 10

Assisted Solution

fostejo earned 500 total points
ID: 16963397

I'd suggest something like RoboCopy, one of the Microsoft Resource Kit tools, available at http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

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

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

568 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