473,396 Members | 2,055 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.

Process Management in windows

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
3 9184
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TJ | last post by:
Making a good old fashioned asp page and need to be able to display the IIS COM+ process id's (i.e. those that show up when attaching to a process in InterDev (in the debug/processes dialog box))....
6
by: Ganesh | last post by:
Is there a utility by microsoft (or anyone) to force garbage collection in a process without have access to the process code. regards Ganesh
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
7
by: Yosh | last post by:
I am developing an application that will stop and start a process on a remote machine. What security rights are needed for my application to be able to do this? Hope this makes sense. Yosh
2
by: Aravind | last post by:
Unable to consume Process reserved memory Hi , This is a Windows form application which interacts with the unmanaged C++ codes . In unmanaged c++ code we allocate around 130MB on the heap for...
1
by: Manfred Braun | last post by:
Hi All, I am writing a tool, which should monitor some exe-processes, which are not very solid. Th main function is to re-start them, if they hung, but this is complicated. I can detect things...
3
by: Keith Grefski | last post by:
I cant seem to figure out how to terminate a process in vb.net i can do it using vbscript and wmi but terminate doesnt seem to exist in the available classes for wmi under vb.net
4
by: Ken Soenen | last post by:
I can get all the processes on the local machine using "GetProcesses". Now I need to know the owner of each of these processes. If the Windows Task Manager could talk, I would ask it.!! Any help...
8
by: =?ISO-8859-15?B?TnXxbw==?= I.G | last post by:
Hello to everybody: I'm trying to get some information about "process management". Let's explain a little... I want to write some code that allows me to execute some "aplications" and collect...
28
by: Jon Davis | last post by:
We're looking at running a memory-intensive process for a web site as a Windows service in isolation of IIS because IIS refuses to consume all of the available physical RAM. Considering remoting to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.