What you're doing there is just comparing strings. How should the command interpreter know that reg query
is a command (besides the fact, that it alone won't yield much useful stuff anyway).
What you need to do here is execute your program, capture its output and then compare. You can do this with the for /f
command:
for /f %%x in ('reg query ...') do ...
However, the output of reg
is human-readable, not machine-readable, so you need some work to get it right. Basically you need to ignore empty lines in that for
statement and the header line as well ... and then you need to find the actual value that's of interest to you. This will get ugly pretty fast.