I require another evaluation on my code
if %programtorun% != "" (
echo test
pause
) else if %foundbootable% (
set oserrorcode=1
) else (
set computererrorcode=2
goto error
)
if %programtorun% == init.lua (
set foundbootable=true
)
I do not know what I'm doing wrong. If you need more details, please ask.
NEQ
instead of!=
. Also when comparing strings quotes are also compared so there's a chance that you should use"%programtorun%"
foundbootable
is.if false (
is invalid syntax. The required syntax isif string1 op string2
where the operator may be one of== equ neq lss gtr leq geq
and the strings need to be quoted if they contain spaces or other separators. If each string is purely numeric then the comparison will be made on the basis of magnitude. It's also possible to useif defined varname
which will be true ifvarname
is an existing environment variable (one that has a value assigned to it)IF
command? There is not a single reference to use!=
as a comparison operator.if /?
and see