Иногда нужно вычислить хеш-сумму файла. Значение хеш-суммы может потребоваться для проверки целостности файла, идентификации файла, поиска файла в глобальной сети.
В Windows есть встроенные утилиты для вычисления хеш-суммы, однако пользоваться ими неудобно. Сделаем, чтобы было удобно. Добавим вычисление хеш-сумм в контекстное меню Windows. Поддерживаются алгоритмы: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512. Нам не потребуется установка дополнительных программ, только прямые руки.
Я разрабатывал меню для Windows 10. В Windows 11 тоже работает, без подсветки при использовании Windows Terminal. В других версиях меню может заработать, или не заработать.
Результат выглядит так
Зажимаем Shift и кликаем правой кнопкой мыши на файл:
В контекстном меню появляется пункт "Хеш-сумма файла". При наведении отображается список поддерживаемых алгоритмов. Выбираем алгоритм, открывается командная строка с вычисленной хеш-суммой:
Все варианты:
Для больших файлов расчёт хеш-суммы может занимать продолжительное время. Для расчёта используется встроенная в Windows утилита certutil.
Вторая версия добавляет название алгоритма и путь к файлу.
Плюсы контекстного меню
- Не требует установки дополнительных программ.
- Установка и удаление одним кликом.
- Запускается для каждого файла отдельно.
- Можно свернуть окно и продолжить работу.
- Из окна командной строки хеш-сумму можно скопировать
- Отображается только для контекстного меню, вызванного с шифтом, не мозолит глаза.
Установка контекстного меню
REG файлы для установки и удаления контекстного меню "internet-lab.ru hash".
Установка контекстного меню
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\internet-lab.ru]
"Extended"=""
"MUIVerb"="Хеш-сумма файла"
"SubCommands"="internet-lab.ru.MD2;internet-lab.ru.MD4;internet-lab.ru.MD5;internet-lab.ru.SHA1;internet-lab.ru.SHA256;internet-lab.ru.SHA384;internet-lab.ru.SHA512;internet-lab.ru.hash.about"
"Position"="Top"
"Icon"="imageres.dll,275"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD2]
@="MD2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD4]
@="MD4"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD5]
@="MD5"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA1]
@="SHA1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA256]
@="SHA256"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA384]
@="SHA384"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA512]
@="SHA512"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.hash.about]
@="О меню"
"CommandFlags"=dword:00000020
"Icon"="imageres.dll,76"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD2\command]
@="cmd.exe /T:0b /K certutil -hashfile \"%1\" MD2 | findstr ^[0-9a-f]$"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD4\command]
@="cmd.exe /T:0b /K certutil -hashfile \"%1\" MD4 | findstr ^[0-9a-f]$"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD5\command]
@="cmd.exe /T:0b /K certutil -hashfile \"%1\" MD5 | findstr ^[0-9a-f]$"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA1\command]
@="cmd.exe /T:0b /K certutil -hashfile \"%1\" SHA1 | findstr ^[0-9a-f]$"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA256\command]
@="cmd.exe /T:0b /K certutil -hashfile \"%1\" SHA256 | findstr ^[0-9a-f]$"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA384\command]
@="cmd.exe /T:0b /K certutil -hashfile \"%1\" SHA384 | findstr ^[0-9a-f]$"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA512\command]
@="cmd.exe /T:0b /K certutil -hashfile \"%1\" SHA512 | findstr ^[0-9a-f]$"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.hash.about\command]
@="cmd.exe /T:0b /K echo Контекстное меню для расчёта хеш-суммы файла. Не устанавливает программ, использует встроенные в Windows утилиты. && echo Аналог \"cmd.exe /T:0b /K certutil -hashfile <путь к файлу> <алгоритм> | findstr ^[0-9a-f]$\" && echo Поддерживаемые алгоритмы: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512. && echo. && echo Версия: 1.02. Создано в internet-lab.ru."
Установка контекстного меню (версия 2)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\internet-lab.ru]
"Extended"=""
"MUIVerb"="Хеш-сумма файла"
"SubCommands"="internet-lab.ru.MD2;internet-lab.ru.MD4;internet-lab.ru.MD5;internet-lab.ru.SHA1;internet-lab.ru.SHA256;internet-lab.ru.SHA384;internet-lab.ru.SHA512;internet-lab.ru.hash.about"
"Position"="Top"
"Icon"="imageres.dll,275"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD2]
@="MD2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD4]
@="MD4"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD5]
@="MD5"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA1]
@="SHA1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA256]
@="SHA256"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA384]
@="SHA384"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA512]
@="SHA512"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.hash.about]
@="О меню"
"CommandFlags"=dword:00000020
"Icon"="imageres.dll,76"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD2\command]
@="cmd.exe /U /T:0b /K certutil -hashfile \"%1\" MD2 | @chcp 1251 >nul & findstr /R /V \"^CertUtil: -hashfile\" & @chcp 866 >nul"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD4\command]
@="cmd.exe /U /T:0b /K certutil -hashfile "%1\" MD4 | @chcp 1251 >nul & findstr /R /V \"^CertUtil: -hashfile\" & @chcp 866 >nul"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD5\command]
@="cmd.exe /U /T:0b /K certutil -hashfile \"%1\" MD5 | @chcp 1251 >nul & findstr /R /V \"^CertUtil: -hashfile\" & @chcp 866 >nul"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA1\command]
@="cmd.exe /U /T:0b /K certutil -hashfile \"%1\" SHA1 | @chcp 1251 >nul & findstr /R /V \"^CertUtil: -hashfile\" & @chcp 866 >nul"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA256\command]
@="cmd.exe /U /T:0b /K certutil -hashfile \"%1\" SHA256 | @chcp 1251 >nul & findstr /R /V \"^CertUtil: -hashfile\" & @chcp 866 >nul"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA384\command]
@="cmd.exe /U /T:0b /K certutil -hashfile \"%1\" SHA384 | @chcp 1251 >nul & findstr /R /V \"^CertUtil: -hashfile\" & @chcp 866 >nul"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA512\command]
@="cmd.exe /U /T:0b /K certutil -hashfile \"%1\" SHA512 | @chcp 1251 >nul & findstr /R /V \"^CertUtil: -hashfile\" & @chcp 866 >nul"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.hash.about\command]
@="cmd.exe /U /T:0b /K echo Контекстное меню для расчёта хеш-суммы файла. Не устанавливает программ, использует встроенные в Windows утилиты. && echo Поддерживаемые алгоритмы: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512. && echo. && echo Версия: 2.02. Создано в internet-lab.ru."
Удаление контекстного меню
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\internet-lab.ru]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD2]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD4]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.MD5]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA1]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA256]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA384]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\internet-lab.ru.SHA512]
Скачать REG для установки контекстного меню "internet-lab.ru hash":
internet-lab.ru hash install.reg
Скачать REG для установки контекстного меню "internet-lab.ru hash" (версия 2):
internet-lab.ru hash install v2.reg
Скачать REG для удаления контекстного меню "internet-lab.ru hash":
internet-lab.ru hash uninstall.reg