473,414 Members | 1,691 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,414 software developers and data experts.

Service as Process

Hello,

I'm looking for a way to identify a running process from which service it is
started. All seems working well so far. I am using a simpel wmi call to
enumerate all running processes and all installed services. I then compare
the 'Pathname' property from the service against the 'Commandline' property
of the running process to see if they match. If they do, I know which
service is my running process. This all works.

I noticed on some test machines that I have multiple identical running
process which are started by different services but the problem is that
those services are all identical too, with the same 'Pathname' property.
Anyone know how I can enumerate those correctly? Maybe I'm doing my check
the wrong way.

Kind rgds,
T.
Aug 8 '05 #1
4 1370
hB
perhaps service is
service.exe
you need to check the command line of the service.exe itself. For
different services running it differs. (entry from the reg).

---
hB

Aug 10 '05 #2

"hB" <ha*********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
perhaps service is
service.exe
you need to check the command line of the service.exe itself. For
different services running it differs. (entry from the reg).


Hello hB,

Thank you for your reply. This is the strange part. These custom services
all have the same starting exe, same commandline but different display
names. I therefore see multiple same exe's in my process list, but do not
know how to enumerate the correct one with the services as they have all the
same commandline. Strange, I know :(

Rgds,
T.
Aug 11 '05 #3
hB
perhaps like path properties there are more properties. (i cant check
now)

you can have some idea by looking at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\
and thier parameters.

---
hB

Aug 13 '05 #4

"TieTo" <no****@home.net> wrote in message
news:V4*********************@phobos.telenet-ops.be...
Hello,

I'm looking for a way to identify a running process from which service it
is
started. All seems working well so far. I am using a simpel wmi call to
enumerate all running processes and all installed services. I then compare
the 'Pathname' property from the service against the 'Commandline'
property
of the running process to see if they match. If they do, I know which
service is my running process. This all works.

I noticed on some test machines that I have multiple identical running
process which are started by different services but the problem is that
those services are all identical too, with the same 'Pathname' property.
Anyone know how I can enumerate those correctly? Maybe I'm doing my check
the wrong way.

Kind rgds,
T.


You misunderstand the service process relationship, a service does not start
a process; a process hosts a service or multiple services and each service
can be controlled separately from the other services in the process.

Services and processes do not have a one to one relationship, a single
process can host multiple services.
And the same host process can run multiple times to host different services,
one example is svchost.exe which runs multple times hosting a multitude of
services.

Willy.
Aug 13 '05 #5

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

Similar topics

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...
7
by: Steve Long | last post by:
In writing a Windows service with .NET, I'm noticing that the process for some services can not be killed with specifically stopping the service. If you try to kill the process with, say task...
23
by: Adam Clauss | last post by:
I have a C# Windows Service running as the NetworkService account because it needs to access a network share. As part of the service's initialization, I want the service to terminate, if an...
2
by: JD | last post by:
Hello, I'm experiencing a problem that I'm hoping someone might be able to shed some light on. I have an ASP.NET page on a Windows 2000 machine that makes web service calls to a .NET web...
5
by: Andrew | last post by:
Hey all, Requesting help from the VB.Net gurus in here. I was given a task to write a Windows Service (VB.Net) that would run an external program, and if that program closed for any reason...
3
by: zxo102 | last post by:
Hi there, I have a python application (many python scripts) and I start the application like this python myServer.py start in window. It is running in dos window. Now I would like to put it...
3
by: tshad | last post by:
I created a service in VS 2003 and the code works fine as an application, but not as a service. It installs fine, but when I try to start it, it tells me it was unable to start. Am I missing...
4
by: kkt49 | last post by:
# vim: et sw=4 ts=8 sts from wxPython.wx import * import sys, os, time import pywintypes import win32serviceutil import win32service import win32event import win32process
5
by: Oriane | last post by:
Hi, I have a .Net Visual Studio solution with one asp.net Web application, which uses a Asp.Net Web service. Both are compiled in debug mode, and both are using the Studio development web server...
2
by: =?Utf-8?B?bXVyYWRqYW1lcw==?= | last post by:
Yes, sorry I tried to make it clear in the original question that I want to get the user token of the service - ie. the account the service is running under. I know services don't have user tokens...
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
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?
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
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
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
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
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.