New
#10
I use in my main autoit script (tool) these functions
must be compiled in autoit in both versions x86 and x64 because we have an HKLM there;----------------------------------------------------------------------------
Func _set_Microsoft_Update_ON ( )
;
Local $_ServiceManager , $_NewUpdateService
;
$_ServiceManager = ObjCreate ("Microsoft.Update.ServiceManager" , @ComputerName)
$_ServiceManager.ClientApplicationID = "My App"
$_NewUpdateService = $_ServiceManager.AddService2 ("7971f918-a847-4430-9279-4a52d1efe18d" , 7 ,"" )
;
EndFunc ;~ _set_Microsoft_Update_ON.
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
Func _set_Microsoft_Update_OFF ( )
;
Local $_ServiceManager , $_NewUpdateService
;
$_ServiceManager = ObjCreate ("Microsoft.Update.ServiceManager" , @ComputerName)
$_ServiceManager.ClientApplicationID = "My App"
$_NewUpdateService = $_ServiceManager.RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
;
EndFunc ;~ _set_Microsoft_Update_OFF.
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
Func _is_Microsoft_Update_ON ( )
;
Local $_tampon = RegRead ( "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services" , "DefaultService" )
;
If $_tampon = "7971f918-a847-4430-9279-4a52d1efe18d" Then
Return True
Else
Return False
EndIf
;
EndFunc ;~ _is_Microsoft_Update_ON.
;----------------------------------------------------------------------------
or just translate them in your favorite programming/scripting language.
when I use above functions Microsoft update did not auto-turn on again, tested on more computers.
the functions works on xp ,vista,7,8.x,10
I can provide compiled scripts (.exe), but this is a trust issue.
c
Last edited by oneLess; 18 Apr 2017 at 09:19.