note 51599 added to function.exec
| From: | netshadow at madpoets dot org | Date: | Tue, 05 Apr 2005 14:13:39 +0000 |
| Subject: | note 51599 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87493@lists.php.net to get a copy of this message | ||
For Win2k/XP systems, and probably NT as well, after beating my head against a wall for a few days
on this, I finally found a foolproof way of backgrounding processes and continuing the script.
For some strange reason I just could not seem to get backgrounding to work with either system or
exec, or with the wsh.run method for that matter. I have used all three in the past with success,
but it just wasn't happening this time.
What I finally wound up doing was using psexec from the pstools package found at http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
You would use it like:
exec("psexec -d blah.bat");
which will start and immediately background blah.bat and immediately resume running the rest of the
php script.
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51599
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51599&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51599&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51599&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51599&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51599&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51599&report=yes
Search -- http://master.php.net/manage/user-notes.php