I have a batch file that I think suits your needs. It uses
FSUM to create the MD5 (although it could be easily amended to use another application). You would need to
download FSUM, and edit the second line in the batch file to reference your actual path to FSUM. To run, just drop the root folder onto the batch file icon, and it will create an MD5 for every folder inside that folder, named the same as the parent folder.
CODE
@ECHO OFF
SET pathToFSUM="C:\Program File\FSUM\FSUM.EXE"
PUSHD %1
FOR /D /r %%G IN (*.*) DO CALL :ProcessFolder "%%G"
POPD
PAUSE
GOTO :EOF
:ProcessFolder
CALL :MakePath "%~1" "#-1#" parentFolder
PUSHD %1
%pathToFsum% -d%1 -jm *.* >"%temp%\%parentFolder%.md5"
MOVE /Y "%temp%\%parentFolder%.md5" %1
POPD
GOTO :EOF
:MakePath
FOR /F "tokens=1-7 delims=\" %%G IN ("%~1") DO CALL :SplitPath "%~1" %2 %3 "%%G" "%%H" "%%I" "%%J" "%%K" "%%L" "%%M"
GOTO:EOF
:SplitPath
SET p0=%~1
Set fullPath=%~2
SHIFT
IF [%3] NEQ [""] SET p1=%~3& SET /A max=1
IF [%4] NEQ [""] SET p2=%~4& SET /A max=2
IF [%5] NEQ [""] SET p3=%~5& SET /A max=3
IF [%6] NEQ [""] SET p4=%~6& SET /A max=4
IF [%7] NEQ [""] SET p5=%~7& SET /A max=5
IF [%8] NEQ [""] SET p6=%~8& SET /A max=6
IF [%9] NEQ [""] SET p7=%~9& SET /A max=7
FOR /L %%G IN (1,1,7) DO CALL :SetReverseVar %%G
FOR /L %%G IN (-7,1,7) DO CALL :ReplaceTokens %%G
SET %2=%fullPath%
GOTO:EOF
:SetReverseVar
IF [%max%] LEQ [0] GOTO:EOF
CALL SET p-%1=%%p%max%%%
SET /A max-=1
GOTO:EOF
:ReplaceTokens
CALL SET token=%%p%1%%
CALL SET fullPath=%%fullPath:#%1#=%token%%%
GOTO:EOF
FYI: Most of the code (90%) is there to work out what the parent folder is called. If anyone has a better method I'd be interested to know. I first developed this code for
this batch file.
Edit: Added /Y to MOVE command to comply with OP's requirement for MD5 to be overwritten.