title: How to delete the one application's registry key from the regedit using python script?
body: <p>I'm new to python. I want to delete the key which is in the regedit using python script.</p>
  
  <p>regedit tree view for my application key</p>
  
  <pre><code>HKEY_CURRENT_USER
  |
  |_Software
          |
          |_Applications
                     |
                     |_Application
                               |_Test1
                               |_Test2
  </code></pre>
  
  <p>In this, <strong>I want to delete Test1 key using python script</strong>.</p>
  
  <p>I've used below script</p>
  
  <pre><code>import _winreg
  Key_Name=r'Software/Applications/Application/Test1'
  Key=_winreg.OpenKey(_winreg.HKEY_CURRENT_USER, Key_Name, 0, _winreg.KEY_ALL_ACCESS)
  _winreg.DeleteKey(key)
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Test\workspace\Test\DeletePreferences.py", line 9, in &lt;module&gt;
      key=_winreg.OpenKey(_winreg.HKEY_CURRENT_USER, r'Software/Applications/Application/Test1', 0, _winreg.KEY_ALL_ACCESS)
  WindowsError: [Error 2] The system cannot find the file specified
  </code></pre>
  
  <p>can anybody suggest solution for this?</p>