Actuellement sur serveurs
Version WAPT Server : 1.7.4
Version WAPT Agent : 1.7.4.6077
version WAPT Setup : 1.7.4.6077
Version WAPT Deploy : 1.7.4.6077
Statut de la base: OK (1.7.4.0)
J'ai ce nouveau script pour bloqué les redémarrage automatique de Windows 10 avec Windows Update
Code : Tout sélectionner
from setuphelpers import *
#list de paquets à oublier tout simplement.
uninstallkey = []
#def main():
def install():
if(windows_version() >= Version('10.0')):
print('is windows 10')
#reg
registry_set('HKEY_LOCAL_MACHINE',r'SOFTWARE/Policies/Microsoft/Windows/WindowsUpdate/AU','NoAutoRebootWithLoggedOnUsers',1,type=REG_DWORD)
# registry_set(HKEY_LOCAL_MACHINE, r'SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System','MaxGPOScriptWait',180,type=REG_DWORD)
print('key set. reboot required to be taken in count.')
else:
print('not w10')
if __name__ == '__main__': #run debug
install()
def uninstall():
if(reg_key_exists('HKEY_LOCAL_MACHINE',r'SOFTWARE/Policies/Microsoft/Windows/WindowsUpdate/AU','NoAutoRebootWithLoggedOnUsers')):
registry_set('HKEY_LOCAL_MACHINE',r'SOFTWARE/Policies/Microsoft/Windows/WindowsUpdate/AU','NoAutoRebootWithLoggedOnUsers',0,type=REG_DWORD)
*** Remote Interpreter Reinitialized ***
is windows 10
Traceback (most recent call last):
File "C:\waptdev\ymg-WU10-autorebootblock-wapt\setup.py", line 23, in <module>
install()
File "C:\waptdev\ymg-WU10-autorebootblock-wapt\setup.py", line 17, in install
registry_set('HKEY_LOCAL_MACHINE',r'SOFTWARE/Policies/Microsoft/Windows/WindowsUpdate/AU','NoAutoRebootWithLoggedOnUsers',1,type=REG_DWORD)
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 1654, in registry_set
with reg_openkey_noredir(root,path,sam=KEY_WRITE,create_if_missing=True) as key:
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 1431, in reg_openkey_noredir
result = _winreg.OpenKey(rootkey,subkeypath,0, sam | _winreg.KEY_WOW64_64KEY)
TypeError: The object is not a PyHKEY object
Et j'ai une erreur similaire si je tente de le déployer via la console ensuite :
Serais-ce une erreur de permissions?is windows 10Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\common.py", line 3818, in install_wapt
exitstatus = setup.install()
File "c:\users\rcu\appdata\local\temp\waptx2yigf\setup.py", line 17, in install
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 1654, in registry_set
with reg_openkey_noredir(root,path,sam=KEY_WRITE,create_if_missing=True) as key:
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 1431, in reg_openkey_noredir
result = _winreg.OpenKey(rootkey,subkeypath,0, sam | _winreg.KEY_WOW64_64KEY)
TypeError: The object is not a PyHKEY object
TypeError: The object is not a PyHKEY object
Merci, cordialement,
Renaud.