Autor Beitrag
LittleBen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: So 04.09.11 17:05 
Hallo,
wie kann ich mehrere Befehle mit ShellExecute ausführen, ohne dass ich eine temporere Batch-Datei erstelle?
Soweit mein Ansatz: ShellExecute(0,nil,'cmd','/K net user'',nil, SW_NORMAL); Was kann ich machen, wenn ich danach noch ipConfig ausführen will?
ShellExecute(0,nil,'cmd','/K net user'+#10#13+'ipConfig',nil, SW_NORMAL); funktioniert ja nicht.

Habt ihr eine Idee?
Vielen Dank!

Grüße,
Benny
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 04.09.11 17:10 
In dem du zwei mal Shellexecute aufrufst?
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: So 04.09.11 17:20 
Angenommen, man wolle gleich einen ganzen Befehlsblock ausführen. Soll man dann 20 mal Shellexecute aufrufen?
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 04.09.11 17:34 
Entweder das in einer Schleife und die Befehle stehen in einer Stringliste oder über eine temporäre Batch-Datei.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 04.09.11 17:40 
Wozu so kompliziert? :gruebel:
ausblenden Delphi-Quelltext
1:
ShellExecute(0nil'cmd.exe''/k net user & ipconfig'nil, SW_SHOWNORMAL);					
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: So 04.09.11 17:45 
Auf so etwas hab ich gewartet :) Vielen Dank! Funktioniert super!