I am trying to compare my computer name with some given string. From reading on google, namely http://commandwindows.com/batchfiles-branching.htm , I tried to execute the following and many variations of the same line with /I
, "%ComputerName"
, A513242
, etc.
IF (%ComputerName% == "A513242") ( EXIT) ELSE ( ECHO "else taken")
where "A513242" is the result of calling ECHO %ComputerName%
it seems to always take a "still taken" branch.
Any help regarding why the ( EXIT
) case fails / what syntax error I am making will be appreciated.
source share