note 70564 rejected from class.com by bobby
| From: | bobby@php.net | Date: | Fri, 20 Oct 2006 14:11:40 +0000 |
| Subject: | note 70564 rejected from class.com by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118849@lists.php.net to get a copy of this message | ||
Note Submitter: sead dot kolic at gmail dot com
----
Hi all,
I'm facing some problems due closing the MS Word process. I use PHP 4.3.2 on a Windows
platform.
This is the php code i've used:
<?php
$word = new COM("word.application") or die("Cannot start Word.");
$word->Quit();
$word->Release();
$word = null;
?>
If I execute this script, a WINWORD.EXE shows up in the list of the Task Manager. This means that
the WINWORD.EXE process is running. The script works. (At least so far). The problem is that this
process is not closing. So if I execute the script again, another WINWORD.EXE process show's up
in the process list of the Task Manager.
Is there a way to get the PID of this process trough a COM function or to get a process list of the
processes executed by the current script, including information like PID, process name etc?
NOTE: Each WINWORD.EXE process get's it's own PID. If there is a way to get the PID of the
process executed by the current script, I could close it manually by using the following PHP
function:
<?php
shell_exec(<kill program> <PID>/<PROCESS NAME>);
?>
If there is another way to close the MS Word (WINWORD.EXE) process, please send me a note.
Best regards,
S. Kolic