title: Reg query with find command and percent character in value
body: <p>I'm trying to determine, in a batch file, if a particular registry key:</p>
  
  <p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v DevicePath</p>
  
  <p>in Windows contains the following value:</p>
  
  <p>%SystemRoot%\inf</p>
  
  <p>The code I have so far is:</p>
  
  <pre><code>reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v DevicePath | find "%SystemRoot%\inf"
  </code></pre>
  
  <p>Unfortunately %errorlevel% always returns 1 and not 0, despite several attempts at playing with the command, adding and removing %'s and escape characters. Can someone assist please? Is there a better way to determine the value of this key?</p>