Autor Beitrag
Kri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 118



BeitragVerfasst: Mo 07.01.08 22:13 
hi leute

ich will für meine freundin ein programm programmieren, welches, wenn man es ausführt sich selbst in einen bestimmten pfad kopiert (C:/Eigene Dateien/).
Dabei soll der Pfad, wo die exe liegt überprüft werden, und ggf. eine Aktion ausgeführt werden.
(if "pfad=eigene dateien then.."
else
...

Wäre Nett wenn ihr mir helfen würdet..

Gruß
Kri
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 07.01.08 22:28 
Mit Application.ExeName kommst du an den Dateinamen deiner Exe, inklusive Pfad. Mit der Funktion ExtractFilePath holst du da den Pfad raus.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Kri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 118



BeitragVerfasst: Mo 07.01.08 22:39 
vielen dank dir!
könnte mir noch jemand erklären wie ich die ausgeführte exe in ein anderes verzeichnis kopieren (nicht verschieben) kann?
zudem müsste ich noch wissen wie man eine datei umbenennt..

Gruß
Kri
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mo 07.01.08 22:47 
CopyFile();
oder war es FileCopy? Bin mir grad nicht sicher

und
RenameFile();

bei beidem hilft jeweils die Hilfe ;)
Danach musst du die Anwendung allerdings neu starten. Vorschlag:
- Datei kopieren
- Zieldatei starten (ShellExecute..)
- Quelldatei schließen (close)
Kri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 118



BeitragVerfasst: Mo 07.01.08 23:18 
ich danke euch vielmals für eure antworten

gruß
kri