After checking the link I got from Metulburr I came up to following code but still failed on
ValueError: Could not convert the data to the specified type.
1 2 3 4 5 6 7 |
import winreg as wreg
def newregkey():
key = wreg.CreateKey(wreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\system" )
wreg.SetValue(key, 'NewSubkey' , wreg.REG_SZ, 'LocalAccountTokenFilterPolicy' )
wreg.SetValueEx(key, 'ValueName' , 0 , wreg.REG_DWORD, '0x00000001' )
key.Close()
|
can any one tell me what is wrong
Traceback:
File "C:\Program Files\Python36\lib\tkinter\__init__.py", line 1702, in __call__
return self.func(*args)
File "C:\page\Backup\LandaUtilitiesInstallar.py", line 407, in <lambda>
self.InstallButtom.bind('<Button-1>',lambda e:LandaUtilitiesInstallar_support.install_lclick(e))
File "C:\page\Backup\LandaUtilitiesInstallar_support.py", line 113, in install_lclick
newregkey()
File "C:\page\Backup\LandaUtilitiesInstallar_support.py", line 70, in newregkey
wreg.SetValueEx(key, 'ValueName', 0, wreg.REG_DWORD, '0x00000001')
ValueError: Could not convert the data to the specified type.