Re: ~Name not defined" error

David Goncalves <[email protected]> Fri, 11 Jul 2008 21:11:17 +0200
Newsgroups gmane.comp.python.windows-ce
Message-ID <[email protected]>
Hi,

> aKey = OpenKey(HKEY_LOCAL_MACHINE,  
> r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
> 
> I have replaced the lines as suggested and now get the error:
> <Type 'exceptions.WindowsError'>:[Error 2] The system cannot find the file
> specified
> 
> Any ideas?

You have to double the backslash because it is interpreted as an esc code :)

aKey = OpenKey(HKEY_LOCAL_MACHINE, 
r"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")

Regards.