On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke <luke@xxxxxxxxxxx> wrote: > Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has > spaces in it.... > Haliphax, thanks for your comments. I tried escapeshellarg() to no end. > > I'm exploring your reply regarding proc_open, but how exactly does > proc_open > separate the arguments from the command? > > Unless i'm mistaken, data written to the process's stdin (for the other > process) is not treated like an argument. > > If I add the arguments to the process name/path? I'm back to square one. > > Luke. > > On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie <nospam@xxxxxxxxxxxxx > >wrote: > > > Kyohere Luke wrote: > > > Hi, > > > I'm trying to use exec to call gammu.exe and send sms on windows XP. > > > > > > This works from commandline: > > > > > > C:\path\to\gammu.exe 1 --sendsms EMS 200 -text "test1 test2" > > > > > > But if I run it through php like this: > > > > > > $command = "\"C:\path\to\gammu.exe\" --sendsms EMS 200 -text \"test1 > > > test2\"".; > > > @exec($command, $response, $retval); > > > > > > This always fails, returns 1 and the response is empty. > > > > > > If the last argument is a string with no spaces, and the double quotes > > were > > > omitted, it works perfectly. > > > > > > If the double quotes are added around the string with no spaces, it > fails > > > again, which makes me believe that the problem is with the double > quotes. > > > > > > I've used procmon and it shows that when the double quotes are added > > around > > > the last argument, gammu.exe is not even called at all. > > > > > > Problem is that the double quotes are required by gammu to send an sms > > with > > > spaces in it. > > > > > > Any ideas? :-( > > > > > > Luke > > > > > > > Why not try: > > > > $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text "test1 test2"'; > > > > -- > > Thanks! > > -Shawn > > http://www.spidean.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > try double slashes for the path and wrap the pathin quotes if there are spaces in it. Or if possible get rid of the spaces in the folder names -- Bastien Cat, the other other white meat