function TForm1.goreg(var regname:string): boolean;
var
MyReg:TRegistry;
begin
MyReg:=TRegistry.Create ;
MyReg.RootKey :=HKEY_LOCAL_MACHINE;
try
if not MyReg.OpenKey ('/SOFTWARE/Microsoft/Windows/CurrentVersion/Run',True)
then
;
begin
MyReg.WriteString('Expleror',regname);
end;
finally
MyReg.Free ;
end;
end;