Solved

Need to write a bat file to copy files

Posted on 2006-06-22
7
421 Views
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
----file1
----file2
----file3
c:\Folder B
----file1
----file2
----file3

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)
----file2
----file3
H:\Folder B
----file1
----file2
----file3
----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..
0
Comment
Question by:chadd25
7 Comments
 
LVL 13

Accepted Solution

by:
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.
0
 
LVL 16

Assisted Solution

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

Assisted Solution

by:fostejo
fostejo earned 125 total points
ID: 16963397
chadd25,

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.

cheers,
0
 
LVL 7

Assisted Solution

by:yotamsher
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
0
 
LVL 7

Expert Comment

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

http://www.microsoft.com/windowsxp/using/digitalphotography/prophoto/synctoy.mspx

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

Yotam
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about a problem I had getting the GPS LocationListener working.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now