Manipulando el registro de windows:
Código Delphi
[-]
Procedure WriteRegData(RootKey: HKEY; Key,Name:String; Value: variant);
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := RootKey;
if Reg.OpenKey(Key, True) then
Reg.WriteString(Name, Value );
finally
Reg.CloseKey;
Reg.Free;
end;
end;
WriteRegData (HKEY_LOCAL_MACHINE ,'\SYSTEM\CurrentControlSet\Services
\SharedAccess\Parameters\FirewallPolicy\StandardProfile\
AuthorizedApplications\List',
MiDirectorio+'\Miprograma.exe',
MiDirectorio+'\Miprograma.exe:*:Enabled:Entorno UPnp');