?
Solved

vbscript and File Compare

Posted on 2002-05-23
11
Medium Priority
?
2,460 Views
Last Modified: 2008-06-18
Remember the old dos command FC?

How would I do that in VBS for a binary comparison?

Thanks
0
Comment
Question by:dds110
[X]
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
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 10

Expert Comment

by:Nitin Sontakke
ID: 7029933
If you could tell the place and purpose of it, it could help. File compare as a program is there in Windows as well in Visual Studio Tools, WinDiff.

Are you planning to use it strictly for binary files? If not, do have a look at FileSystemObject implementation, it could help.

Nitin.
0
 
LVL 20

Accepted Solution

by:
hes earned 100 total points
ID: 7030041
This example should work in vbs

http://www.coderoom.com/file_util_vb3.html
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7030066
Do you need to know if they are changed?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Author Comment

by:dds110
ID: 7030091
Once a week I move a large file to an archive server.  Before I delete the original copy, I run fc through the command prompt to ensure It got there in good shape.  I am trying to write a script that will do this for me.  The reason for the vbs script is this:  I "have" to prompt for the names of the files.  I'm using Winnt and my company is too cheap to buy VS.  The example that Hes suggested looks viable, but I'm not completely sold on it.  I need to FC the two files to ensure that there was no change from one server to the archive server.  I prefer to do this with the binary switch.  
0
 
LVL 8

Author Comment

by:dds110
ID: 7030435
Found a good solution, searching elsewhere.  Basically, I'm reading the files as an open text stream, then binary comparing the strings using the FSO.  I would like to award partial points to hes since his idea prompted me to search further.  I'll be getting in touch with one of the moderators to do that tommorrow.

Thanks Guys

DS
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7030463
OK. Just take care that files are not huge or that code will runs slooooowly.
0
 
LVL 20

Expert Comment

by:hes
ID: 7030473
Glaad to have pointed you to your solution, and as Richie said make sure the files are not that large.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7030613
optionally, i think you could run your DOS FC with Wscript object.
Cheers
0
 
LVL 3

Expert Comment

by:baldrick
ID: 7031994
If the files are particularly large, running FC might be a bit slow - If this becomes a problem you might want to look into implementing a CRC (Cyclic Redundancy Check) which was designed to quickly detect data corruption.

Regards
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7033803
I was thinking: If you are using fso, you could test for datelastmodified property instead of compare them in binary way. I think it is faster.
0
 

Expert Comment

by:PUCK
ID: 7037556
Points reduced to 25 by request and answer accepted.  Have a nice day.  :)

PUCK
CS Moderator
PUCK@experts-exchange.com
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

764 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