vbscript and File Compare

Remember the old dos command FC?

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

Thanks
LVL 8
dds110Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nitin SontakkeDeveloperCommented:
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
hesCommented:
This example should work in vbs

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richie_SimonettiIT OperationsCommented:
Do you need to know if they are changed?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

dds110Author Commented:
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
dds110Author Commented:
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
Richie_SimonettiIT OperationsCommented:
OK. Just take care that files are not huge or that code will runs slooooowly.
0
hesCommented:
Glaad to have pointed you to your solution, and as Richie said make sure the files are not that large.
0
Richie_SimonettiIT OperationsCommented:
optionally, i think you could run your DOS FC with Wscript object.
Cheers
0
baldrickCommented:
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
Richie_SimonettiIT OperationsCommented:
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
PUCKCommented:
Points reduced to 25 by request and answer accepted.  Have a nice day.  :)

PUCK
CS Moderator
PUCK@experts-exchange.com
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

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.