473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.

Jul 17 '05 #1
5 3165
<wr******@gmail.com> wrote in message
news:11*********************@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).
Jul 17 '05 #2
On Mon, 21 Feb 2005 00:27:20 -0500, "Chung Leong" <ch***********@hotmail.com>
wrote:
<wr******@gmail.com> wrote in message
news:11*********************@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 / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #3
Thanks so much, that pslist did the trick perfectly.

Jul 17 '05 #4
>>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?

Jul 17 '05 #5
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

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
2
by: Russ McDaniel | last post by:
Originally posted to microsoft.public.dotnet.distributed_apps with no response. Reposted here with additional thoughts. --- Hello, I'm writing a Windows service which performs some...
0
by: Just D. | last post by:
Guys, I'm writing the Windows Application and one of the ideas is to use a RichText field to store/show some formatted text, probably with pictures. The problem is that this RichEdit control is...
2
by: rodchar | last post by:
hey all, i have 2 jobs running in the background and you can see them in task manager. is there a way i can create a quick windows form to show the status of just those 2 jobs to show that their...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
14
by: Alex K. | last post by:
Hi all I'd like to avoid starting the same c# application twice on the same computer. How do I check if it is already running? Thank you
5
by: =?Utf-8?B?WWFlbA==?= | last post by:
Hi, I have this method in my c# vs.net 2003 code: ================= Start Code ================= private void isOutlook() { Microsoft.Win32.RegistryKey key =...
5
by: ags5406 | last post by:
I've a Windows Service that keeps a particular executable running. If the executable fails for whatever reason, the Service restarts it. Right now I'm using a loop to check if the process is...
12
by: Shadlan | last post by:
Hi. I need to know if a service is running on my server. Is there any PHP instruction that I can use to do this?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.