Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi shellexecute mit pipes im command (https://www.delphipraxis.net/78582-shellexecute-mit-pipes-im-command.html)

gigo02 7. Okt 2006 07:36


shellexecute mit pipes im command
 
hallo ich habe nen kleines problem,

ich würde gerne ein programm erstellen was mir folgendes shellcommando ausführt

\python25\python.exe \temp\mplayer\camproxy.py "http://xxx.dyndns.org:82/axis-cgi/mjpg/video.cgi?resolution=320x240&compression=15&des_fp s=2" 2 | \temp\mplayer\mencoder -demuxer rawvideo -rawvideo w=320:h=240:format=rgb24:fps=2 -nosound -ffourcc FLV1 -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=300:keyint=10 -lavfopts i_certify_that_my_video_stream_does_not_use_b_fram es -o \Programme\xampp\htdocs\customervid\flv\abc.flv -really-quiet - | \cygwin\bin\tail.exe -f \Programme\xampp\htdocs\customervid\flv\abc.flv

da ich ja hier mehrer pipes drin habe was ne datenübergabe zum nächsten programm macht geht das ja mit shell execute nicht so einfach, wie muss ich vorgehen ?

bin für jegliche hilfe dankbar.

mfg enrico hofmann

marabu 7. Okt 2006 07:59

Re: shellexecute mit pipes im command
 
Herzlich willkommen in der Delphi-PRAXiS, Enrico.

Da die Behandlung von pipes und redirection eine Funktionalität der Shell ist, musst du beim Aufruf entweder die Shell aufrufen oder alles in einen Befehlsstapel verpacken.

Freundliche Grüße vom marabu

r2c2 7. Okt 2006 08:27

Re: shellexecute mit pipes im command
 
Hallo :hi:

Versuchs mal so:
Delphi-Quellcode:
Shellexecute(..., 'cmd /C sonstwas | eigabe'...);
Pipes sind IMHO n Feature von der cmd...

//Roter Kasten:
Marabu hats eigentlich schon gesagt. Trotzdem hier nochmal mit Code...

mfg

Christian

gigo02 7. Okt 2006 08:57

Re: shellexecute mit pipes im command
 
hallo danke,

erstmal danke,

daraus entseht nur folgendes problem.

die commando übergabe darf nur 255 zeichen lang sein.

[Pascal Error] vrecord.pas(38): E2056 String literals may have at most 255 elements

was kann ich denn da machen ?

mfg enrico

r2c2 7. Okt 2006 09:03

Re: shellexecute mit pipes im command
 
Batchdatei erstellen und die ausführen...

mfg

Christian

gigo02 7. Okt 2006 09:10

Re: shellexecute mit pipes im command
 
hi ok das funktioniert,

aber ich habe trotzdem noch das gleiche problem,
die batch beendet sich nicht wenn ich das programm schliesse :(

wie mus ich da vorgehen ?
irgend eine idee, das dosfenster bleibt halt offen und läuft weiter wenn ich das delphi programm beende

r2c2 7. Okt 2006 09:15

Re: shellexecute mit pipes im command
 
In OnClose das Dos-Fenster abschießen?

mfg

Christian

gigo02 7. Okt 2006 09:18

Re: shellexecute mit pipes im command
 
wie kann ich denn das dos fenster ansprechen ?

mfg enrico

r2c2 7. Okt 2006 09:23

Re: shellexecute mit pipes im command
 
IMHO: Über CreateProcess erstellen. Dann erhälst du n Handle zurück. Mit dem dann den Prozess killen. Da gibts mit Sicherheit was in der Codelib, etc.

mfg

Christian

gigo02 7. Okt 2006 09:39

Re: shellexecute mit pipes im command
 
sorry wenn ich nochmal nerfe, kann zwar nen bissel delphi bin aber eigentlich webentwickler.

wie muss das konkret bei eine

consolen applikation aussehen ?


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:24 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz