12.06.2011, 13:07
Because when you cd, it only changes directory for that call. Your second call for exec() doesn't recognize your use of 'cd' because it goes back to default.
Basically:
Try merging the two commands in to one call for exec().
Basically:
PHP код:
exec("cd /directory");
// cd is only remembered for the command above. It's forgotten the next time you call exec()
exec("start samp-server.exe"); // It can't find it because it doesn't remember the cd command used