I'd like to run a program that creates MD5 hashes of a bunch of files from VBA, redirecting the output to a file. I have what seems like it ought to be a workable solution, but something isn't working right when I try to run it from VBA. Hoping somebody here can help me!
The program is md5deep.exe, which I downloaded from Sourceforge, at http://md5deep.sourceforge.net/
The executable resides in my c:\program files\md5deep directory.
From a command prompt, I enter
and I get what I wanted, a new text file named md5results.txt that has the hashes for every text file in the C:\ directory. Okay, let's call that same thing from VBA and life will be good, right? Not so fast!"c:\program files\md5deep\md5deep" -b C:\*.txt > C:\md5results.txt
My code is:
[VBA]Sub test2()
Dim RetVal
RetVal = Shell("""c:\program files\md5deep\md5deep"" -b C:\*.txt > C:\md5results2.txt", vbNormalFocus)
End Sub[/VBA]
When I call that sub, I can see the flash of a DOS window, even glimpsing what appear to be hash-looking lines of characters, but no new (c:\md5results2.txt) file gets created.
(The -b flag tells the program to omit directory info from the resulting output, so file names show up as FileName.txt instead of C:\FileName.txt within the output.)
Can anybody point out what I'm doing wrong here?
Many thanks!
G.T.