Set oExec = WshShell.exec("C:\Users\Administrator\desktop\experimenting\md5.exe_
-odup5.txt """ & ostream.write & """")
The above will fail, because you can't use line-wrapping inside strings. Also, ostream.write
means you're trying to write something to an ADODB Stream object. What you actually want to do (assuming I understood your question correctly and you're using this md5.exe
) is something like this:
WshShell.Run "C:\...\md5.exe -ochunk_md5.txt -d""" & data & """"
To write the results of all chunks of data to the same file, do something like this:
WshShell.Run "%COMSPEC% /c md5.exe -o- -d""" & data & """>chunk_md5.txt", 1, True
or like this:
Set md5 = WshShell.Exec("md5.exe -o- -d""" & data & """")
Do While md5.Status = 0
WScript.Sleep 100
Loop
objFSO.OpenTextFile("chunk_md5.txt", 8, True).Write md5.StdOut.ReadAll
Or you could use this VBScript for calculating the hash and write the result to a file.