Autor Beitrag
JeanvanHees
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Fr 13.09.02 10:29 
Tag :wink2:

Hier 'ne einfache frage, die scheinbar so einfach ist das ich nirgendwo anders die antwort kan finden.

Ich möchte gern weil mein program lauft eine *.exe runnen die in eine andere directory steht.
Ich weiß noch das es ganz einfach war das in C zu machen, also kann es auch in Delphi nicht swierig sein..oder :?:

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Fr 13.09.02 10:47 
Such mal hier im Forum nach shellexecute und createprocess

_________________
Gruß

Wolfgang

----------
zu hause ist es doch am schönsten
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Fr 13.09.02 11:17 
Ok,
Ich hab schon etwas mit shellexecute bei Delphi32.com gefunden und es funktioniert prima
Danke :dance:

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Fr 13.09.02 12:32 
Ooh, Ich brauchte es eigentlich noch etwas complizierter ich möchte einen dos command runnen

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
thePraYeR
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 27



BeitragVerfasst: Fr 13.09.02 13:03 
Wenn es ein Kommando des Interpreters ist, dann mußt Du es als Parameter an diesen übergeben.

Bsp.: "command.com dir c:"

Ansonsten Ausführung mit SchellExecute oder CreateProcess wie gehabt.
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Fr 13.09.02 13:50 
Ok, aber das problem ist jetzt, Ich muß nach 'ne bestimmte directory in das command prompt, und von da aus einen program runnen.

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 13.09.02 14:20 
Hi
sollte auch nicht das Problem sein. Du kannst ja dein Programm mitsamt dem Pfadnamen angeben
command.com c:\sonstwo\anders\Prog.exe
Oder du schreibst die Befehle zum Verzeichniswechsel und Programmstart in eine Batch-Datei und startest die.
Aufpassen musst du höchstens bei langen Dateinamen. Weiss nicht ob das mit denen auch funktioniert.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Fr 13.09.02 14:39 
Ok, wenn ich im startmenu von windows run selectiere (ich weiß nicht wie das bei die deutsche windows heißt) und ich setze dan dies hier dorthin

Zitat:
cmd /k C:\bla1\bla2\stdutil -q -m -s C:\ -d C:\ -f hallo.z

(stdutil ist ein program das der file hallo.z von source C:\ übersetzt und auf destination C:\ setzt)
funktioniert es, aber nicht in delphi.
Aber wenn ich nur das cmd will geht es schon in delphi, aber ich kann dort nicht die zeile am wirken bringen.... nicht mit ShellExecute jedenfalls:crying: [/quote]

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 13.09.02 14:58 
Hi
probier mal
ausblenden Quelltext
1:
2:
3:
sPrg:=PChar('cmd /k C:\bla1\bla2\stdutil'); 
sPrm:= PChar('-q -m -s C:\ -d C:\ -f hallo.z'); 
ShellExecute(Handle, 'open', sPrg, sPrm, nil, SW_SHOWNORMAL);

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Fr 13.09.02 15:09 
Es hat nicht funktioniert, ich bekomm nicht ein mal das cmd zu sehen.
Danke für die mühe jedenfalls.

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Fr 13.09.02 15:32 
:dance: :dance2:
Ich hab ihm...Dein code war beinahe richtig LCS..
Diese site hat auch gute informationeen drüber
www.mvps.org/vbnet/i...ell/shellexecute.htm

Nochmals danke, meinen tag ist wieder gerettet :D

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!