Hey,
Due the many files and exe's, that I deploy from my system. Sometimes it happens that some exe or file gets corrupted.
Therefor I want to add a script to my release scripts. That generates MD5's from files and exe's that is gathered from my pc. And when it is uploaded to the remote pc's it checks the MD5's.
Is this possible? If so, what do I need to use for that.
thnx
MD5 Create and Remote Check
Moderator: DosItHelp
Re: MD5 Create and Remote Check
See copying & verifing checksums http://forum.wincmd.ru/viewtopic.php?p=58069
Options: names.list "d:\destination\"
Names.list format is
Options: names.list "d:\destination\"
Names.list format is
Code: Select all
file.ext
file too.ext
file 3.ext
folder\
folder too\
folder 3\
Re: MD5 Create and Remote Check
thanks mate, wil look into tonight, since the website u gave is blocked by my current firewall
Re: MD5 Create and Remote Check
Code: Select all
@echo off
rem Copying & verifing checksums
rem Options: names.list "d:\destination\"
rem Uses: RHash http://rhash.anz.ru/
setlocal enableextensions
for /f "delims=" %%n in (%1) do (
call :x "%%n" "%~2"
)
move ~hashs~.tmp "%~2~hashs~.tmp"
chdir /d "%~2"
for /f "usebackq delims=" %%h in ("%~2~hashs~.tmp") do (
title Check %%h
rhash.exe -c --ansi %%h 2>nul |findstr /r /c:"ERROR, .* should be" >>~err~.txt
)
for %%e in (~err~.txt) do (if "%%~ze"=="0" del "%%~nxe" /q)
if exist ~err~.txt start ~err~.txt
del "%~2~hashs~.tmp" /q
exit /b
:x
set "l=%~1"
title Hashing "%l%"
if "%l:~-1%"=="\" (
rhash.exe -r -M --ansi "%l:~0,-1%" >>"%l:~0,-1%.md5" 2>nul
title Copying "%l%"
xcopy "%l%*" "%~2%l%" /i /s/e /k/r/h >nul
type "%l:~0,-1%.md5" >>"%~2%l:~0,-1%.md5"
echo "%l:~0,-1%.md5" >>~hashs~.tmp
) else (
rhash.exe -M --ansi "%l%" >>"%l%.md5" 2>nul
title Copying "%l%"
echo f| xcopy "%l%" "%~2%l%" /k/r/h >nul
type "%l%.md5" >>"%~2%l%.md5"
echo "%l%.md5" >>~hashs~.tmp
)
goto :eof