import winreg
path = winreg.HKEY_LOCAL_MACHINE
software = winreg.OpenKeyEx(path, r'HARDWARE\DESCRIPTION\System\CentralProcessor\0\\')
winreg.SetValueEx(software, 'ProcessorNameString', 0, winreg.REG_SZ, 'Intel(R)')
if software:
winreg.CloseKey(software)
It gives me a WinError 5 when I run this code.
How can I get administrator access to this file using a Python module or script, as it needs to run with elevation?