Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Process IDs

Status
Not open for further replies.

TomSark

MIS
Oct 19, 2000
448
US
Does anyone know how to obtain a process id for a process running on an NT Server?

For a given process name, I want to obtain the associated process ID, such as that which you would find when you list running processes in Task Manager...

Thanks in Advance...

Tom
 
There's a lot of good NT specific stuff at
I haven't tried this but you might be able to get what you need from the code in:

VCA.gif

Alt255@Vorpalcom.Intranets.com
 
This site has some very useful examples, but not exactly what I'm looking for. I need to get the process ID for certain processes.

Basically... I want to programmatically get the same into about processes that Task Manager does...

Thanks Alt255 for the response though..

Tom
 
Let me rephrase the question: How do I enumerate all running processes on an NT server in order to obtain the data in the PROCESS_INFORMATION structure?

Tom
 
BTW... I'm using NT 4.0 so I will need to somehow obtain the handle to all of the processes...

Tom
 
There is a FAQ to list all applications running on NT.

faq222-61

You could incorporate the GetProcessID function to get what you need.
 
Solution 2 in the FAQ looks like what I am looking for. But... how do I make use of the CreateToolhelpSnapshot API call.. I doesn't seem to exist in kernal32...

Thanks,

Tom
 
I've just discovered that this is a Windows 2000 ONLY API call... and solution 1 in the FAQ won't work because I want to peer into MTS processes (mtx.exe). Any other suggestions?

Tom
 
Hi,

After doing extensive research, if found a way to do this in NT 4. An article at:
answers most of this. They cheat and go through the perfmon objects (process counter) to get the info. You can get all kinds of process-releated info from the counter's instance data...

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top