|
本帖最后由 qq8899399 于 2024-11-18 15:23 编辑
自带的 就行啊
代码如下
添加
- Windows Registry Editor Version 5.00
- [-HKEY_CLASSES_ROOT\*\shell\hash]
- [-HKEY_CLASSES_ROOT\Directory\shell\hashDirectory]
- #右键菜单 哈希值校验 添加
- [HKEY_CLASSES_ROOT\*\shell\hash]
- "MUIVerb"="Hash 值校验"
- "SubCommands"=""
- "icon"="SHELL32.dll,22"
- "Position"="Bottom"
- ; SHA1
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\001menu]
- "MUIVerb"="SHA1"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\001menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm SHA1 | format-list"
- ; SHA256
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\002menu]
- "MUIVerb"="SHA256"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\002menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm SHA256 | format-list"
- ; SHA384
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\003menu]
- "MUIVerb"="SHA384"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\003menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm SHA384 | format-list"
- ; SHA512
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\004menu]
- "MUIVerb"="SHA512"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\004menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm SHA512 | format-list"
- ; MACTripleDES
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\005menu]
- "MUIVerb"="MACTripleDES"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\005menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm MACTripleDES | format-list"
- ; MD5
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\006menu]
- "MUIVerb"="MD5"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\006menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm MD5 | format-list"
- ; RIPEMD160
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\007menu]
- "MUIVerb"="RIPEMD160"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\007menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm RIPEMD160 | format-list"
- ; SHA1 (保存txt)
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\011menuouttxt]
- "CommandFlags"=dword:00000020
- "MUIVerb"="SHA1 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\011menuouttxt\command]
- @="powershell -noexit -command "$filePath = '%1'; $fileName = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fullFileName = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; Get-FileHash -LiteralPath $filePath -Algorithm SHA1 | Select-Object @{Name='Algorithm';Expression={$_.Algorithm}}, @{Name='Hash';Expression={$_.Hash}}, @{Name='FullFileName';Expression={$fullFileName}}, @{Name='CurrentTime';Expression={$currentTime}} -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileName)) -Append"; exit"
- ; SHA256 (保存txt)
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\012menuouttxt]
- "MUIVerb"="SHA256 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\012menuouttxt\command]
- @="powershell -noexit -command "$filePath = '%1'; $fileName = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fullFileName = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; Get-FileHash -LiteralPath $filePath -Algorithm SHA256 | Select-Object @{Name='Algorithm';Expression={$_.Algorithm}}, @{Name='Hash';Expression={$_.Hash}}, @{Name='FullFileName';Expression={$fullFileName}}, @{Name='CurrentTime';Expression={$currentTime}} -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileName)) -Append"; exit"
- ; SHA384 (保存txt)
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\013menuouttxt]
- "MUIVerb"="SHA384 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\013menuouttxt\command]
- @="powershell -noexit -command "$filePath = '%1'; $fileName = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fullFileName = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; Get-FileHash -LiteralPath $filePath -Algorithm SHA384 | Select-Object @{Name='Algorithm';Expression={$_.Algorithm}}, @{Name='Hash';Expression={$_.Hash}}, @{Name='FullFileName';Expression={$fullFileName}}, @{Name='CurrentTime';Expression={$currentTime}} -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileName)) -Append"; exit"
- ; SHA512 (保存txt)
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\014menuouttxt]
- "MUIVerb"="SHA512 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\014menuouttxt\command]
- @="powershell -noexit -command "$filePath = '%1'; $fileName = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fullFileName = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; Get-FileHash -LiteralPath $filePath -Algorithm SHA512 | Select-Object @{Name='Algorithm';Expression={$_.Algorithm}}, @{Name='Hash';Expression={$_.Hash}}, @{Name='FullFileName';Expression={$fullFileName}}, @{Name='CurrentTime';Expression={$currentTime}} -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileName)) -Append"; exit"
- ; MACTripleDES (保存txt)
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\015menuouttxt]
- "MUIVerb"="MACTripleDES (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\015menuouttxt\command]
- @="powershell -noexit -command "$filePath = '%1'; $fileName = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fullFileName = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; Get-FileHash -LiteralPath $filePath -Algorithm MACTripleDES | Select-Object @{Name='Algorithm';Expression={$_.Algorithm}}, @{Name='Hash';Expression={$_.Hash}}, @{Name='FullFileName';Expression={$fullFileName}}, @{Name='CurrentTime';Expression={$currentTime}} -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileName)) -Append"; exit"
- ; MD5 (保存txt)
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\016menuouttxt]
- "MUIVerb"="MD5 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\016menuouttxt\command]
- @="powershell -noexit -command "$filePath = '%1'; $fileName = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fullFileName = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; Get-FileHash -LiteralPath $filePath -Algorithm MD5 | Select-Object @{Name='Algorithm';Expression={$_.Algorithm}}, @{Name='Hash';Expression={$_.Hash}}, @{Name='FullFileName';Expression={$fullFileName}}, @{Name='CurrentTime';Expression={$currentTime}} -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileName)) -Append"; exit"
- ; RIPEMD160 (保存txt)
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\017menuouttxt]
- "MUIVerb"="RIPEMD160 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\017menuouttxt\command]
- @="powershell -noexit -command "$filePath = '%1'; $fileName = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fullFileName = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; Get-FileHash -LiteralPath $filePath -Algorithm RIPEMD160 | Select-Object @{Name='Algorithm';Expression={$_.Algorithm}}, @{Name='Hash';Expression={$_.Hash}}, @{Name='FullFileName';Expression={$fullFileName}}, @{Name='CurrentTime';Expression={$currentTime}} -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileName)) -Append"; exit"
- ; Allget-filehash -literalpath '%1' -algorithm RIPEMD160 | format-list
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\018menu]
- "CommandFlags"=dword:00000020
- "MUIVerb"="Show all"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\*\shell\hash\shell\018menu\command]
- @="powershell -noexit get-filehash -literalpath \\"%1\\" -algorithm SHA1 | format-list;get-filehash -literalpath \\"%1\\" -algorithm SHA256 | format-list;get-filehash -literalpath \\"%1\\" -algorithm SHA384 | format-list;get-filehash -literalpath \\"%1\\" -algorithm SHA512 | format-list;get-filehash -literalpath \\"%1\\" -algorithm MACTripleDES | format-list;get-filehash -literalpath \\"%1\\" -algorithm MD5 | format-list;get-filehash -literalpath \\"%1\\" -algorithm RIPEMD160 | format-list"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory]
- "icon"="SHELL32.dll,22"
- "SubCommands"=""
- "MUIVerb"="Hash 校验目录下所有文件"
- "Position"="Bottom"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell]
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\001]
- "MUIVerb"="SHA1 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\001\command]
- @="powershell.exe -NoExit -Command "$folderPath = '%1'; Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object { $filePath = $_.FullName; $fileNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fileNameWithExt = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; $fileHash = Get-FileHash -LiteralPath $filePath -Algorithm SHA1; $fileHash | Add-Member -NotePropertyName 'OriginalFileName' -NotePropertyValue $fileNameWithExt -PassThru | Add-Member -NotePropertyName 'CurrentTime' -NotePropertyValue $currentTime -PassThru | Select-Object Algorithm, Hash, OriginalFileName, CurrentTime -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileNameWithoutExt)) -Append }; Write-Host '文件夹内所有文件 SHA1 验证完毕.'""
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\002]
- "MUIVerb"="SHA256 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\002\command]
- @="powershell.exe -NoExit -Command "$folderPath = '%1'; Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object { $filePath = $_.FullName; $fileNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fileNameWithExt = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; $fileHash = Get-FileHash -LiteralPath $filePath -Algorithm SHA256; $fileHash | Add-Member -NotePropertyName 'OriginalFileName' -NotePropertyValue $fileNameWithExt -PassThru | Add-Member -NotePropertyName 'CurrentTime' -NotePropertyValue $currentTime -PassThru | Select-Object Algorithm, Hash, OriginalFileName, CurrentTime -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileNameWithoutExt)) -Append }; Write-Host '文件夹内所有文件 SHA256 验证完毕.'""
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\003]
- "MUIVerb"="SHA384 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\003\command]
- @="powershell.exe -NoExit -Command "$folderPath = '%1'; Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object { $filePath = $_.FullName; $fileNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fileNameWithExt = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; $fileHash = Get-FileHash -LiteralPath $filePath -Algorithm SHA384; $fileHash | Add-Member -NotePropertyName 'OriginalFileName' -NotePropertyValue $fileNameWithExt -PassThru | Add-Member -NotePropertyName 'CurrentTime' -NotePropertyValue $currentTime -PassThru | Select-Object Algorithm, Hash, OriginalFileName, CurrentTime -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileNameWithoutExt)) -Append }; Write-Host '文件夹内所有文件 SHA384 验证完毕.'""
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\004]
- "MUIVerb"="SHA512 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\004\command]
- @="powershell.exe -NoExit -Command "$folderPath = '%1'; Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object { $filePath = $_.FullName; $fileNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fileNameWithExt = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; $fileHash = Get-FileHash -LiteralPath $filePath -Algorithm SHA512; $fileHash | Add-Member -NotePropertyName 'OriginalFileName' -NotePropertyValue $fileNameWithExt -PassThru | Add-Member -NotePropertyName 'CurrentTime' -NotePropertyValue $currentTime -PassThru | Select-Object Algorithm, Hash, OriginalFileName, CurrentTime -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileNameWithoutExt)) -Append }; Write-Host '文件夹内所有文件 SHA512 验证完毕.'""
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\005]
- "MUIVerb"="MACTripleDES (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\005\command]
- @="powershell.exe -NoExit -Command "$folderPath = '%1'; Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object { $filePath = $_.FullName; $fileNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fileNameWithExt = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; $fileHash = Get-FileHash -LiteralPath $filePath -Algorithm MACTripleDES; $fileHash | Add-Member -NotePropertyName 'OriginalFileName' -NotePropertyValue $fileNameWithExt -PassThru | Add-Member -NotePropertyName 'CurrentTime' -NotePropertyValue $currentTime -PassThru | Select-Object Algorithm, Hash, OriginalFileName, CurrentTime -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileNameWithoutExt)) -Append }; Write-Host '文件夹内所有文件 MACTripleDES 验证完毕.'""
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\006]
- "MUIVerb"="MD5 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\006\command]
- @="powershell.exe -NoExit -Command "$folderPath = '%1'; Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object { $filePath = $_.FullName; $fileNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fileNameWithExt = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; $fileHash = Get-FileHash -LiteralPath $filePath -Algorithm MD5; $fileHash | Add-Member -NotePropertyName 'OriginalFileName' -NotePropertyValue $fileNameWithExt -PassThru | Add-Member -NotePropertyName 'CurrentTime' -NotePropertyValue $currentTime -PassThru | Select-Object Algorithm, Hash, OriginalFileName, CurrentTime -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileNameWithoutExt)) -Append }; Write-Host '文件夹内所有文件 MD5 验证完毕.'""
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\007]
- "MUIVerb"="RIPEMD160 (保存txt)"
- "icon"="SHELL32.dll,22"
- [HKEY_CLASSES_ROOT\Directory\shell\hashDirectory\shell\007\command]
- @="powershell.exe -NoExit -Command "$folderPath = '%1'; Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object { $filePath = $_.FullName; $fileNameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($filePath); $fileNameWithExt = [System.IO.Path]::GetFileName($filePath); $currentTime = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'; $fileHash = Get-FileHash -LiteralPath $filePath -Algorithm RIPEMD160; $fileHash | Add-Member -NotePropertyName 'OriginalFileName' -NotePropertyValue $fileNameWithExt -PassThru | Add-Member -NotePropertyName 'CurrentTime' -NotePropertyValue $currentTime -PassThru | Select-Object Algorithm, Hash, OriginalFileName, CurrentTime -ExcludeProperty Path | Format-List | Out-File -FilePath (Join-Path (Split-Path -Parent $filePath) ('{0}_hash.txt' -f $fileNameWithoutExt)) -Append }; Write-Host '文件夹内所有文件 RIPEMD160 验证完毕.'""
复制代码
移除
- Windows Registry Editor Version 5.00
- #右键菜单 哈希值校验 删除
- [-HKEY_CLASSES_ROOT\*\shell\hash]
- [-HKEY_CLASSES_ROOT\Directory\shell\hashDirectory]
复制代码
|
|