Recently related backup more frequently, in order to verify the integrity of the file, always open a file hash check tool, more trouble, so wrote this dongdong, the file is a little slow to calculate, the file MD5 value saved on the Clipboard
Recent related backup more frequently, in order to verify the integrity of the file, always open a file hash check tool, more trouble, and wrote this dongdong, the file is a little slow to calculate, the file's MD5 value saved in the Clipboard! Effect as shown:
How to use:
1. Import the Getmd5.reg file into the registry first to add a right-click menu, Getmd5.reg the following code:
Copy Code code as follows:
Windows Registry Editor Version 5.00
[Hkey_classes_root*shellhash (&g) command]
@= ' WScript.exe//nologo c:windowssystem32getmd5.vbs '%1 ' '
2. Copy Getmd5.vbs to C:windowssystem32, complete all operations, Getmd5.vbs code as follows:
Copy Code code as follows:
Public Md5value
md5sum (wscript.arguments (0))
Setclipboardtext ("MD5:" & Md5value & ", FilePath:" & WScript.Arguments (0))
Function md5sum (filename)
Dim MyStream, myhashed, Md5value
Set MyStream = CreateObject ("ADODB. Stream ")
Mystream.type = 1
Mystream.open ()
mystream.loadfromfile (filename)
Set myhashed = CreateObject ("CAPICOM. Hasheddata ")
Myhashed.algorithm = 3
Myhashed.hash (Mystream.read ())
Mystream.close
Md5value = Myhashed.value
End Function
Sub Setclipboardtext (Text)
Dim Word
Set Word = CreateObject ("Word.Application")
Word.Documents.Add
Word.Selection.Text = Text
Word.Selection.Copy
Word.quit False
End Sub
If the script is running wrong, please download and register the CAPICOM component