Huhu ! - I have problems with calling an extern prog.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Super-Zinken
Forum Newbie
Posts: 4
Joined: Tue Jan 07, 2003 6:12 am
Contact:

Huhu ! - I have problems with calling an extern prog.

Post by Super-Zinken »

Hello everybody !
Ic used the following Code:

<html>
<?php
exec("c:\ProgZ\write.exe");
?>
</html>

But i doenst work, no write is opening.

I use IE on Windows system.

Perhaps someone can help me, THX !
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try exec("c:/ProgZ/write.exe"); or at least exec("c:\\ProgZ\\write.exe");. A single ''' escapes the special meaning of next the character but there is nothing special about 'P' and 'w' ;)
Super-Zinken
Forum Newbie
Posts: 4
Joined: Tue Jan 07, 2003 6:12 am
Contact:

hmm..

Post by Super-Zinken »

I did, but althought it doenst work.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://www.php.net/manual/en/function.exec.php
string exec ( string command [, array output [, int return_var]])
maybe you should check the return value and/or pass the output parameter to the function and check the value as well.

Code: Select all

is_file('c:/ProgZ/write.exe') or die('does not exist');
before the exec might be helpful, too
Super-Zinken
Forum Newbie
Posts: 4
Joined: Tue Jan 07, 2003 6:12 am
Contact:

Huhu !

Post by Super-Zinken »

the file exists.
perhaps we can chat.
My ICQ#: 178260546
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

Try putting your command into a string.

$string="c:/ProgZ/write.exe";
exec($string);

I use it like that using system command.
Super-Zinken
Forum Newbie
Posts: 4
Joined: Tue Jan 07, 2003 6:12 am
Contact:

Post by Super-Zinken »

ojeeeeeeeee !
Notjing work !
even that with the String did not work.
Hey, you Avatar loos funny !
Post Reply