1.

Solve : Please help with batch file problem?

Answer»

Hi,
I wonder if anybody can help?
I am making a batch file but I cannot get the comparison to work.
Where am I going wrong?
Any help or advice appreciated.

Quote

FOR /F "tokens=*" %%R IN ('md5sums -u c:\windows\system32\drivers\tcpip.sys') DO SET curver=%%R

set ver18000=48a5b7570b9a866208ae217acdb72b26 *tcpip.sys

IF "%curver%" == "%ver18000%" (GOTO gotmatch) ELSE GOTO nomatch


:gotmatch
echo got match
GOTO END
:nomatch
echo no match
GOTO end
:end
echo exit

I think it must be something to do with the IF PART. Welcome to the CH forums.

Try this (UNTESTED):

IF "%curver%" equ "%ver18000%" (GOTO gotmatch) ELSE GOTO nomatchYou don't really need an ELSE

IF [test] goto true

echo test failed!
goto end

:true
echo test passed!

:end
WHat are you trying to do and y r u putting quotationmarks around VARIABLES? Why are you resurrecting the dead? Check the post dates...


Discussion

No Comment Found