By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,717 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,717 IT Pros & Developers. It's quick & easy.

Process Management in windows

P: n/a
All I need to do is run a windows batch file from a small php program, and
return the windows process id of the batch file. I have played around with
proc_open() but that returns a resource id. Does anyone have a suggestion
on what call I could use to get the windows process id returned within my
program. I am using windows xp pro, and php 5/apache

Thanks

Rick
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Rick Westmacott <r_**********@hotmail.com> wrote:
All I need to do is run a windows batch file from a small php program, and
return the windows process id of the batch file. I have played around with
proc_open() but that returns a resource id. Does anyone have a suggestion
on what call I could use to get the windows process id returned within my
program. I am using windows xp pro, and php 5/apache

Thanks

Rick


At least in PHP4 there was a php_w32api (or similar), which allows you to
access winapi functions directly. Then look for a suitable function in the
MSDN/any tutorial/elsewhere which you can call through the winapi.

Anyway, php_w32api nearly completely sucked on my system (~1 year ago)...
For some strange reason, the maximum of possible calls to the winapi was
TWO! (Either two functions or one function twice.)
Further at that time the official manual on php_w32api was unusable, too,
but Google found a nice function description list.

You could give it a try, but if didn't improved a lot since then, you
shouldn't expect too much.
--
Simon Stienen <http://dangerouscat.net> <http://slashlife.de>
»What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done.«
-- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle
Jul 17 '05 #2

P: n/a

"Rick Westmacott" <r_**********@hotmail.com> wrote in message
news:ux***************@newsread3.news.pas.earthlin k.net...
All I need to do is run a windows batch file from a small php program, and
return the windows process id of the batch file. I have played around with proc_open() but that returns a resource id. Does anyone have a suggestion
on what call I could use to get the windows process id returned within my
program. I am using windows xp pro, and php 5/apache

Thanks

Rick


Try using tasklist.exe.
Jul 17 '05 #3

P: n/a
Thanks,

I knew of tasklist, but I need to trap the process id when each batch file
starts. I will have many process of the same name running, and wouldn't
know which one to kill. Im thinking of trying out winbatch which can
apparently do anything. We'll see...

Rick

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:yO********************@comcast.com...

"Rick Westmacott" <r_**********@hotmail.com> wrote in message
news:ux***************@newsread3.news.pas.earthlin k.net...
All I need to do is run a windows batch file from a small php program,
and
return the windows process id of the batch file. I have played around

with
proc_open() but that returns a resource id. Does anyone have a
suggestion
on what call I could use to get the windows process id returned within my
program. I am using windows xp pro, and php 5/apache

Thanks

Rick


Try using tasklist.exe.

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.