set x=9
if %x%==9 (command1) else (command2)
注: if 要跟 command1的左括号同行,else要跟command1的右括号及command2的左括号同行,command可以不与括号同行