title: Deleting registry keys in batch file (ERROR: Access is denied)
body: <p>I'm trying to delete registry keys in a batch file, here's what I'm doing. </p>
  
  <pre><code>reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM" /f
  </code></pre>
  
  <p>I'm recieving the following error:</p>
  
  <pre><code>ERROR: Access is denied.
  </code></pre>
  
  <p>Yet I can simply open regedit.exe and right click and delete the registry key no problem! To state the obvious, I have elevated the batch file instance as administrator, am logged in as administrator, and tried running the batch from a cmd and powershell instance both as administrator. The Administrator account has full permissions for the registry keys, which is why I'm able to delete them simply through the regedit GUI. This is part of a large batch file script, the point is I want the whole process to be automated. Any ideas?</p>