How can I execute FCIV and obtain a hash for a file using VBA?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Every pure VBA implementation I have seen has been painfully slow (sometimes over a minute per file). There may be a way to do this by tapping a Windows COM library but I am not currently aware of any such method. (I hope someome knows of one though and you’ll see why in a second:)) The best I have been able to come up with is a somewhat ugly workaound so the following suggestion may not be suitable in all scenarios but there is a very fast command line utility available from MS here: http://support.microsoft.com/kb/841290. The utility does MD5 and SHA1. Although the site says it’s for Windows XP I can verify it works with versions up through and including Windows 7. I haven’t tried it on 64 bit though.
A few caveats:
1. This utility is unsupported. I have never had any issues with it. But it’s still a consideration.
2. The utility would have to be present on any machine you intended to run the code on and this may not be feasible in all circumstances.
3. Obviously this is a bit of a hack/kludge so you may want to test it a little for error conditions etc.
4. I just banged this together. I haven’t tested it/worked with it. So take 3 seriously:)