Rem Create a variable to illustrate the use of the IF statement Set MY_VAR=ValueA Rem Now check the variable using IF - if the value of the variable is Rem the string 'ValueA', the script will go to the label WasValueA Rem and continue execution IF .%MY_VAR%.==.ValueA. GOTO WasValueA Rem This is the equivalent of the else clause Echo MY_VAR was not ValueA Goto BatchEnd :WasValueA Echo MY_VAR was ValueA Rem We'll just fall through to the end of the batch sequence... :BatchEnd Rem This is the end of the batch sequence, so we'll cleanup Rem the variable that we used. Set MY_VAR=