From b399a9e2c9019174b1253ad210930c0324a827fc Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Wed, 25 Oct 2023 12:26:12 -0400 Subject: [PATCH] Add batch scripts for getting file checksum --- dotfiles/bin/file-checksum-md5.bat | 11 +++++++++++ dotfiles/bin/file-checksum-sha1.bat | 11 +++++++++++ dotfiles/bin/file-checksum-sha256.bat | 11 +++++++++++ dotfiles/bin/file-checksum-sha512.bat | 11 +++++++++++ 4 files changed, 44 insertions(+) create mode 100644 dotfiles/bin/file-checksum-md5.bat create mode 100644 dotfiles/bin/file-checksum-sha1.bat create mode 100644 dotfiles/bin/file-checksum-sha256.bat create mode 100644 dotfiles/bin/file-checksum-sha512.bat diff --git a/dotfiles/bin/file-checksum-md5.bat b/dotfiles/bin/file-checksum-md5.bat new file mode 100644 index 0000000..2c254dd --- /dev/null +++ b/dotfiles/bin/file-checksum-md5.bat @@ -0,0 +1,11 @@ +@echo off + +if exist %1\* ( + echo Run on a file +) else ( + if exist "%~1_checksum-md5.txt" ( + del "%~1_checksum-md5.txt" + ) + certutil.exe -hashfile "%~1" MD5 > "%~1_checksum-md5.txt" + start notepad "%~1_checksum-md5.txt" +) diff --git a/dotfiles/bin/file-checksum-sha1.bat b/dotfiles/bin/file-checksum-sha1.bat new file mode 100644 index 0000000..c548e5b --- /dev/null +++ b/dotfiles/bin/file-checksum-sha1.bat @@ -0,0 +1,11 @@ +@echo off + +if exist %1\* ( + echo Run on a file +) else ( + if exist "%~1_checksum-sha1.txt" ( + del "%~1_checksum-sha1.txt" + ) + certutil.exe -hashfile "%~1" SHA1 > "%~1_checksum-sha1.txt" + start notepad "%~1_checksum-sha1.txt" +) diff --git a/dotfiles/bin/file-checksum-sha256.bat b/dotfiles/bin/file-checksum-sha256.bat new file mode 100644 index 0000000..85ab0ae --- /dev/null +++ b/dotfiles/bin/file-checksum-sha256.bat @@ -0,0 +1,11 @@ +@echo off + +if exist %1\* ( + echo Run on a file +) else ( + if exist "%~1_checksum-sha256.txt" ( + del "%~1_checksum-sha256.txt" + ) + certutil.exe -hashfile "%~1" SHA256 > "%~1_checksum-sha256.txt" + start notepad "%~1_checksum-sha256.txt" +) diff --git a/dotfiles/bin/file-checksum-sha512.bat b/dotfiles/bin/file-checksum-sha512.bat new file mode 100644 index 0000000..1f38209 --- /dev/null +++ b/dotfiles/bin/file-checksum-sha512.bat @@ -0,0 +1,11 @@ +@echo off + +if exist %1\* ( + echo Run on a file +) else ( + if exist "%~1_checksum-sha512.txt" ( + del "%~1_checksum-sha512.txt" + ) + certutil.exe -hashfile "%~1" SHA512 > "%~1_checksum-sha512.txt" + start notepad "%~1_checksum-sha512.txt" +)