Autor Beitrag
klezmor
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 24.09.05 14:08 
Ich will ein Programm schreiben, welches in seiner direktion 3 neue Ordner anlegt und sich dann jeweils selbst in jeden Ordner kopiert, dann sollen sich diese 3 Programme wieder ausführen, also eine exponentielle Zunahme soweit bin ich schon :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.FormCreate(Sender: TObject);
var i:integer;
    name:string;
begin
form1.Visible:=false;
for i:=1 to 3 do
begin

createdir(inttostr(i));
copyFile(PChar(getcurrentdir+'\'+application.Title+'.exe'), PChar(getcurrentdir+'\'+inttostr(i)+'\'+inttostr(i)+'.exe'), false);
shellexecute(application.handle,'open',PCHAR(getcurrentdir+'\'+inttostr(i)+'\'+inttostr(i)+'.exe'),nil,nil,SW_SHOW);

end;

das Programm vermehrt sich zwar aber ich glaube nicht exponentiell, eigentlich müssten ja in jedem Ordner wiederum 3 neue angelegt werden, dies aber geschieht nicht weiß jemand wieso?

MFG

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Sa 24.09.05 14:10 
wahrscheinlich funktioniert das shellexecute einfach nicht (falsch angewendet) werden die programme denn neu gestartet.

und ich weiß nicht wie lange der thread offen bleibt, da das was du machst nicht wirklich sinnvoll ist und eher für nen virus oder nen nerv programm gedacht ist.

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Sa 24.09.05 14:14 
Ja ich weiß der Nutzen des Programmes lässt zu wünschen übrig aber ich wollte einfach mal sehen, wie sowas funktioniert.
Das shellexecute funzt schon aber es legt nihct immer wieder neue ordner an, inwelchen es sich ausführt.
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Sa 24.09.05 14:20 
GetCurrentDIr stimmt nich

nimm besser ExtractFilePath(Paramstr(0))

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 480

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 24.09.05 19:18 
Solange kein glaubwürdiges sinnvolles Einsatzgebiet für ein solches Programm geliefert wird, bleibt dieser Thread erst einmal
*closed*

_________________
We are, we were and will not be.
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.