[PythonCE] ~Name not defined" error

Alexandre Delattre alexandre.delattre at enst-bretagne.fr
Fri Jul 11 21:32:29 CEST 2008


David Williams wrote:
> I have replaced the lines as suggested and now get the error:
> <Type 'exceptions.WindowsError'>:[Error 2] The system cannot find the 
> file specified
>
> I would be grateful for any further help.
> Thank you
> David williams
>
> 2008/7/11 <alexandre.delattre at telecom-bretagne.eu>:
>
>     ConnectRegistry seems not to be implemented in PythonCE
>
>     However you can still replace:
>
>
>     aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
>
>     aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
>
>     by:
>
>     aKey = OpenKey(HKEY_LOCAL_MACHINE,
>     r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
>
>
>     _______________________________________________
>     PythonCE mailing list
>     PythonCE at python.org <mailto:PythonCE at python.org>
>     http://mail.python.org/mailman/listinfo/pythonce
>
>

Hmm, you must make sure the key is existing in your device registry.
Try to double check this and that the key isn't mispelled (btw, I use 
PHM Regeditor
on my pda for this kind of stuff 
<http://www.phm.lu/Products/PocketPC/RegEdit/>)

The use of raw string r"..." notation prevents you from having to escape 
\ characters,
maybe give a try to:

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

Hope it helps,
Alexandre



More information about the PythonCE mailing list