Possible to check to see if Windows process is running from PHP?

This is a discussion on Possible to check to see if Windows process is running from PHP? within the PHP Language forums, part of the PHP Programming Forums category; I need to check the state of a processes from within a PHP script on a Windows machine. All I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2005
wrybread@gmail.com
 
Posts: n/a
Default Possible to check to see if Windows process is running from PHP?

I need to check the state of a processes from within a PHP script on a
Windows machine. All I need to know is whether or not the process
exists (i.e., is running). Anyone have any ideas?

I searched the archives and found proc_open(), but if it can do what
I'm trying to do, I can't figure out how.

Reply With Quote
  #2 (permalink)  
Old 02-21-2005
Chung Leong
 
Posts: n/a
Default Re: Possible to check to see if Windows process is running from PHP?

<wrybread@gmail.com> wrote in message
news:1108937050.288502.91410@o13g2000cwo.googlegro ups.com...
> I need to check the state of a processes from within a PHP script on a
> Windows machine. All I need to know is whether or not the process
> exists (i.e., is running). Anyone have any ideas?
>
> I searched the archives and found proc_open(), but if it can do what
> I'm trying to do, I can't figure out how.
>


Google for tlist.exe (pre-XP) or tasklist.exe (XP).


Reply With Quote
  #3 (permalink)  
Old 02-22-2005
Andy Hassall
 
Posts: n/a
Default Re: Possible to check to see if Windows process is running from PHP?

On Mon, 21 Feb 2005 00:27:20 -0500, "Chung Leong" <chernyshevsky@hotmail.com>
wrote:

><wrybread@gmail.com> wrote in message
>news:1108937050.288502.91410@o13g2000cwo.googlegr oups.com...
>> I need to check the state of a processes from within a PHP script on a
>> Windows machine. All I need to know is whether or not the process
>> exists (i.e., is running). Anyone have any ideas?
>>
>> I searched the archives and found proc_open(), but if it can do what
>> I'm trying to do, I can't figure out how.
>>

>
>Google for tlist.exe (pre-XP) or tasklist.exe (XP).


There's also some goodies here that may be of use:

http://www.sysinternals.com/ntw2k/fr.../pstools.shtml

(And various other useful tools on that site)

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #4 (permalink)  
Old 02-22-2005
wrybread@gmail.com
 
Posts: n/a
Default Re: Possible to check to see if Windows process is running from PHP?

Thanks so much, that pslist did the trick perfectly.

Reply With Quote
  #5 (permalink)  
Old 02-22-2005
alanbe
 
Posts: n/a
Default Re: Possible to check to see if Windows process is running from PHP?

>>I need to check the state of a processes from within a PHP script on
a
>>Windows machine. All I need to know is whether or not the process
>>exists (i.e., is running). Anyone have any ideas?


>>I searched the archives and found proc_open(), but if it can do what
>>I'm trying to do, I can't figure out how.



Curious. Why do you need to do this?
What processes runnng in Windows are you interested in?

Reply With Quote
  #6 (permalink)  
Old 02-25-2005
wrybread@gmail.com
 
Posts: n/a
Default Re: Possible to check to see if Windows process is running from PHP?

I built a photobooth, and PHP does the scripting. So the PHP script
(running in Windows) tells a program called PSRemote to take 4
pictures, then PHP passes the pictures to a Photoshop droplet to
arrange them in a strip, then prints them, then the PHP script uploads
the pics.

The problem is, if someone clicked the button to take more pics while
the script was running, it would crash. So a kludgey solution was to
check if the processes php.exe was running, and if so abort. In essence
I'm preventing multiple instances of the script.

Here's the photobooth, if you're interested:

http://wrybread.com/photobooth

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:40 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0