@echo off setlocal enabledelayedexpansion if "%~1"=="" ( echo Drag and drop a finalized PDF file onto this tool. pause exit /b ) set "FILE=%~1" set "NAME=%~nx1" set "SIZE=%~z1" for /f "tokens=1" %%A in ('certutil -hashfile "%FILE%" MD5 ^| findstr /r /v "hash CertUtil"') do ( set "HASH=%%A" ) set "LINE=%NAME%: %SIZE% bytes, checksum: %HASH% (MD5)" echo. echo ===================== IMPORTANT ===================== echo Only replace the checksum line in DSpace. echo Do NOT overwrite the full provenance field. echo. echo Replace the line AFTER: echo "No. of bitstreams: 1" echo And BEFORE: echo "Previous issue date" echo ===================================================== echo. echo Copy this line into DSpace: echo. echo %LINE% echo. :: Copy to clipboard echo %LINE% | clip echo [Copied to clipboard] echo. pause