IF %processor_architecture% == AMD64 (SET querypath=hklm\software\x) ELSE (SET dsetquerypath=hklm\software\y)
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 hklm\software\x(on 32bit windows) and hklm\software\y(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 hklm\software\y.
I don't know WHY? That is what I need help to make this batch file right.