computing
  • 1

Compare Two Strings In Batch

  • 1

if Test==Test (
echo in if condition.
— do something —
)
) else (
echo in else condition.
— do something —
)
The output it is giving me is
in if condition
in else condition.

not sure why this is happening..even though two strings are same..can anyone help please??

thanks in advance

Share

1 Answer

  1. )
    ) else (

    You’re ending your IF block, closing a non-existent block of code, and adding an ELSE block. Strangely, CMD never thinks about saying something.

    Get rid of the ) line before the ) else ( line.

    How To Ask Questions The Smart Way

    • 0