View Full Version : system call

05-20-2004, 11:00 PM
I used system() function to excute a command this command will include a path which contain white spaces, it seems for me that the system function does not except the white spaces, and it cut the path when it figure the white space... is there any solution????

05-21-2004, 02:21 AM
You can try exec() instead..


05-21-2004, 12:48 PM
on win32 ? just adding quotes around the path works I think .. else use shorthand .. c:/PROGRA~1/blah.exe etc

exec('"c:/program files/blah.exe"');

05-21-2004, 06:20 PM
I haven't tried it myself, but actually I would think putting quotes around the bits with spaces would need the quotes:

exec("c:/'program files'/blah.exe");

So because program files is two words but a single directory, you'd put quotes around it. Using the command prompt on Windows XP. that's how I do it, so I assume it's the same here..