By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,960 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,960 IT Pros & Developers. It's quick & easy.

Service as Process

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a

"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 discussion thread is closed

Replies have been disabled for this discussion.