IF %processor_architecture% == AMD64 (SET querypath=hklmsoftwarex) ELSE (SET dsetquerypath=hklmsoftwarey)
FOR /F "tokens=* delims=" %%G IN ( REG QUERY "%querypath%" 2^>NUL ) DO ECHO %%G
Let me explain what im trying to accomplish out of this batch command. Basically there is a tool which gets intalled on hklmsoftwarex(on 32bit windows) and hklmsoftwarey(on 64 bit windows).
I need the exact path of the software from registry.Which could tell me whether the machine is 32 or 64 bit and take appropriate action. But right now every time I using this batch command it is always returning path as hklmsoftwarey.
I don t know WHY? That is what I need help to make this batch file right.