hi

i'd like to call an exe with several parameters like this:
the parameter -name= must have quotes from beginning til end because of the
Spaces between.
       C:/Programme/Apache
Group/Apache2/htdocs/myexe.exe -action=add -name="My Own Task"

so i tried this in PHP... but it dows not work! It only works when i take
out the \"... however i can't do this because my exe neeads the parameter
like this:

// ---- CODE ------
$execString = "\"C:/Programme/Apache Group/Apache2/htdocs/myexe.exe\""
// i have to use \" because of the spaces
    ." -action=add"
    ." -name=\"My Own Task\"";                     // i have to use \"
because of the spaces
exec(escapeshellarg($execString), $arrRes, $iret);
print_r($arrRes);
// ---- CODE ------
$arrRes is empty although the exe ALWAYS gives a return value

on www.php.net i found the functions escapeshellarg and escapeshellcmd.
could these functions be the solution i'm looking for? i really don't know
how to use them for my case.

can anybody give me a hint please...
Regards,
Juerg







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to