DWORD registry value - prohibiting an executable
Published: February 6, 2017 - 10:34 AM
Good morning,
I'm having trouble adding a DWORD value to the registry; I get the following message when running session-setup:
CRITICAL ValueError: Could not convert the data to the specified type.
It's the same with the values 1 or 0x00000001.
I'm having trouble adding a DWORD value to the registry; I get the following message when running session-setup:
CRITICAL ValueError: Could not convert the data to the specified type.
It's the same with the values 1 or 0x00000001.
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
import time
import os
uninstallkey = []
def GetUserName():
return os.getenv('USERNAME')
def install():
print('Installation de DisallowRun')
def session_setup():
utilisateur = GetUserName()
if(utilisateur == "eleve"):
registry_set(HKEY_CURRENT_USER,r'Software/Microsoft/Windows/CurrentVersion/Policies/Explorer/','DisallowRun','0x00000001',type=REG_DWORD)
registry_set(HKEY_CURRENT_USER,r'Software/Microsoft/Windows/CurrentVersion/Policies/Explorer/DisallowRun','1','shutdown.exe',type=REG_SZ)