4 Replies - 956 Views - Last Post: 30 June 2013 - 10:46 AM Rate Topic: -----

#1 Mbare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 02-September 12

winreg Openkey : Permissionerror

Posted 29 June 2013 - 03:11 PM

HI
when I try to access to some directory , for example:

#python 3.3

import winreg
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,'path\to\mynetworkList\directory')


but : Permissionerror [Winerror 5] access denied...occur

then I have disabled UAC in Windows 7, but problem persists... :splat:
some opinions?

thanks in advance!!

Is This A Good Question/Topic? 0
  • +

Replies To: winreg Openkey : Permissionerror

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10561
  • View blog
  • Posts: 39,079
  • Joined: 27-December 08

Re: winreg Openkey : Permissionerror

Posted 29 June 2013 - 03:45 PM

Moved to Python. Please reserve the Advanced Discussion forums for advanced, topical discussion; not help questions.
Was This Post Helpful? 0
  • +
  • -

#3 Mbare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 02-September 12

Re: winreg Openkey : Permissionerror

Posted 30 June 2013 - 04:28 AM

ohh, my mistake!! sorry
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: winreg Openkey : Permissionerror

Posted 30 June 2013 - 10:21 AM

Try making your string a "raw" string with the r flag:

#python 3.3

import winreg
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'path\to\mynetworkList\directory')




Without the r I'm pretty sure the backslashes are interpreted as escaped control characters.
Was This Post Helpful? 0
  • +
  • -

#5 Mbare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 02-September 12

Re: winreg Openkey : Permissionerror

Posted 30 June 2013 - 10:46 AM

HI
in original source code obviously I put in 'r' flag...;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1