Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

vbscript and File Compare

Posted on 2002-05-23
11
Medium Priority
?
2,465 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
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 11

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

810 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