You can use an IF test to see if a variable is "defined", i.e. if it has been declared, either by a SET statement or by the system (like %username%, etc) The test is IF DEFINED variablename command. As with all IF tests you can test for the opposite (if it has NOT been defined) by inserting the word NOT after the IF keyword. That variable only exists in a 64 bit session on a 64 bit system. Thus if it is not defined we might not have a 64 bit system.
(You did know you can look all this kind of thing up on the web?) Type if defined batch into Google.