title: Empty file when trying to save registry key to file in Python
body: <p>I want to export registry key to file in Python 3.8 but I'm getting only empty file (0kb) with nothing in it. Obviously I'm starting the script by elevating privileges to admin otherwise I would get a permission error. </p>
  
  <p>It goes like this:</p>
  
  <pre><code>if is_admin():
  
      klucz = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Printers', 0, winreg.KEY_SET_VALUE)
      file = (r"C:\SRCnetwork.reg")
      winreg.SaveKey(klucz, file)
  </code></pre>
  
  <p>Any idea what I might be missing ? </p>