Ver Mensaje Individual
  #2  
Antiguo 13-10-2010
jor jor is offline
Registrado
NULL
 
Registrado: oct 2010
Posts: 2
Reputación: 0
jor Va por buen camino
Thumbs up listo socio aqui le dejo el codigo

el codigo que expongo a continuación me funciona bien para xp pero lo e probado en windows 7 como administrador y no me funciona.
no se que estara mal por lo que e leido windows 7 tiene modificaciones en lo que al accso al registro ,y sospecho que sea cosa de prmisos.

este es sl codigo


//direxe =>'C:\WINDOWS\system32\MIEJECUTABLE.EXE');
//clavenomb=> nombre calve creada

procedure tMainForm.crear_clave(clavenomb,direxe : string);
begin

try
Registro:=TRegistry.create;
Registro.RootKey := HKEY_LOCAL_MACHINE;
if Registro.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run',FALSE) then
begin
if not(registro.ValueExists(clavenomb) )then
begin // SI NO EXISTE EL NOMBRE DE LA CLAVE

try
Registro.WriteString(clavenomb,direxe);

except
InicioActiveX();

end;




end







End;//OPEN KEY


finally
Registro.Destroy;

end;

end;


listo le agradesco mucho que me puedan a yudar
Responder Con Cita