Valore di registro DWORD: proibisce un eseguibile
Pubblicato: 6 febbraio 2017 - 10:34
Buongiorno,
Ho problemi ad aggiungere un valore DWORD al registro; quando eseguo session-setup ricevo il seguente messaggio:
CRITICAL ValueError: Impossibile convertire i dati nel tipo specificato.
Lo stesso vale per i valori 1 o 0x00000001.
Ho problemi ad aggiungere un valore DWORD al registro; quando eseguo session-setup ricevo il seguente messaggio:
CRITICAL ValueError: Impossibile convertire i dati nel tipo specificato.
Lo stesso vale per i valori 1 o 0x00000001.
Codice: Seleziona tutto
# -*- 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)