Eric Harris
asked on
Compare date and size of 2 files (DOS)
Hi There,
I have s problem related to 2 physical sites (networked) where I work.
Files are replicated between the 2 sites. Sometimes, the replication fails, or is switched off.
The file (an excel file) is used and updated frequently between the 2 sites therefore making the replication very important in order not to miss updates performed at either end.
Short of redesigning the network I'm looking for a short term solution.
I thought maybe I would replace the file with a Batch file written in DOS which would compare the modified datetime, and the file sizes.
If the same then I would continue to open the excel file.
If different I would display a warning message containing the dates and the sizes depending on which was the newest etc, and then exit.
The DOS solution is quick and cheap solution to a real problem.
However, I'd be interested in any ideas.
Help would be appreciated
I have s problem related to 2 physical sites (networked) where I work.
Files are replicated between the 2 sites. Sometimes, the replication fails, or is switched off.
The file (an excel file) is used and updated frequently between the 2 sites therefore making the replication very important in order not to miss updates performed at either end.
Short of redesigning the network I'm looking for a short term solution.
I thought maybe I would replace the file with a Batch file written in DOS which would compare the modified datetime, and the file sizes.
If the same then I would continue to open the excel file.
If different I would display a warning message containing the dates and the sizes depending on which was the newest etc, and then exit.
The DOS solution is quick and cheap solution to a real problem.
However, I'd be interested in any ideas.
Help would be appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both solutions are excellent.
I think the 1st solution only checks the file sizes. (apologies if I'm wrong)
THat would work in most cases unless it generated a file exactly the same size with changes in it.
Comparing the dates as well is the capture all solution.
However, I'm going to psplit the points as I believe that Compaqus would have enhanced the solution
THanks to both of you
I think the 1st solution only checks the file sizes. (apologies if I'm wrong)
THat would work in most cases unless it generated a file exactly the same size with changes in it.
Comparing the dates as well is the capture all solution.
However, I'm going to psplit the points as I believe that Compaqus would have enhanced the solution
THanks to both of you
ASKER
A Brilliant response.
==> I think the 1st solution only checks the file sizes. (apologies if I'm wrong)
The first solution used FC which will actually compare the CONTENTS of the two files to make sure they are indeed identical. So even if the date stamps were different, if the contents hadn't changed, it would report them as identical. That may, or may not be what you want, just wanted to clarify.
~bp
The first solution used FC which will actually compare the CONTENTS of the two files to make sure they are indeed identical. So even if the date stamps were different, if the contents hadn't changed, it would report them as identical. That may, or may not be what you want, just wanted to clarify.
~bp
Open in new window