Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 30.01.05 09:48 
Hi, Delpher,

mir schwebt folgendes vor:
Aus einer Listbox, in der mehrere Befehle stehen, möchte ich diese nacheinander bei
Programmende abarbeiten lassen.

Also eigentlich eine typische Batch-Datei, z.Bleistift:
ausblenden Quelltext
1:
2:
    copy *.dbf C:\Ziel
    del *.~*


Die Befehle könnten sich erweitern, deshalb die Listbox.

Wie geht so etwas?
(habe schon im Forum gesucht --> copyfile und shellexecute gefunden, aber
ist mir noch nicht der Bringer(flexibel genug))

Wer kann helfen?
Detlef Annies

Moderiert von user profile iconraziel: Code-Tags hinzugefügt
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 30.01.05 10:27 
wieso speicherst du denn nicht die listbox ab als batchdatei und führst die dann mit shellexecute aus ?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 30.01.05 10:34 
Hi, Matze,

scusi, ähh - und wie geht das? Ist wohl genau mein Problem ...

D. Annies
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 30.01.05 10:39 
Wenn ich da jetzt keinen Fehler reingebaut habe, so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
uses ShellAPI
... 
ListBox1.Items.SaveToFile('C:\MyBatch.bat');
ShellExecute(Handle,'open',pchar('C:\MyBatch.bat'),PChar(''),nil,SW_SHOW);
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 30.01.05 11:05 
genau so dachte ich mir das.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 30.01.05 11:33 
Hi, Matze und elite!

Funzt prächtig, habe sogar noch den alten pause-Befehl am Ende der .bat gesetzt.
.. Ja, das waren noch Zeiten ...

Danke für die Hilfe,
Detlef Annies