I want to kill the service process using a script. I am looking for a
solution other than using a 3rd party program (like taskkill.exe or
kill.exe).
How to do this?
Thanks!
Walker.
I want to kill the service process using a script. I am looking for a
solution other than using a 3rd party program (like taskkill.exe or
kill.exe).
How to do this?
Thanks!
Walker.
Check out the ControlService API which lets you pause, stop etc. a service.
To use it you need to get two handles first:
Check out the Platform SDK for more details about it.
Hth,
Andreas H?ber
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-186506-
xxxxx@lists.osr.com] On Behalf Of WalkerNet
Sent: Sunday, September 05, 2004 6:23 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to kill a service process? Help!I want to kill the service process using a script. I am looking for a
solution other than using a 3rd party program (like taskkill.exe or
kill.exe).
How to do this?Thanks!
Walker.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256You are currently subscribed to ntdev as: xxxxx@frisurf.no
To unsubscribe send a blank email to xxxxx@lists.osr.com
However, I want to kill(not stop) that service process.
Because some processes not be killed by the Windows Task Manager, and they
are not listed the Windows Services Manager, I couldn’t stop it.
In addition, sometimes the service hangs. So, how can I kill/terminate(not
stop) the process that is hung using a script?
My OS is Windows2000. Thanks!
Walker.
“Andreas Häber” wrote in message news:xxxxx@ntdev…
Check out the ControlService API which lets you pause, stop etc. a service.
To use it you need to get two handles first:
1) For the SCM - use OpenSCManager.
2) For the service - use OpenService.
Check out the Platform SDK for more details about it.
Hth,
Andreas Häber
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:bounce-186506-
> xxxxx@lists.osr.com] On Behalf Of WalkerNet
> Sent: Sunday, September 05, 2004 6:23 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to kill a service process? Help!
>
> I want to kill the service process using a script. I am looking for a
> solution other than using a 3rd party program (like taskkill.exe or
> kill.exe).
> How to do this?
>
> Thanks!
>
> Walker.
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@frisurf.no
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
If SCM doesn’t get a response after 30 seconds(if I remember correctly) from
the service after sending it a stop message the service will be terminated
by SCM. This is described in the Platform SDK in more detail.
However, what you may be asking for is the TerminateProcess API to simply
terminate the process?
But if you give some more details of the service you need to terminate then
it would be easier to find a solution for you. Since it doesn’t show up in
the ‘Service Manager’ list it doesn’t seem like a generic service…
Through WMI you can access these methods to use them in scripts. See the
Win32_Process and Win32_Service WMI classes. There are some examples for
using these in scripts at the MS Technet site.
Regards,
Andreas H?ber
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-186525-
xxxxx@lists.osr.com] On Behalf Of WalkerNet
Sent: Monday, September 06, 2004 12:34 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to kill a service process? Help!However, I want to kill(not stop) that service process.
Because some processes not be killed by the Windows Task Manager, and they
are not listed the Windows Services Manager, I couldn’t stop it.In addition, sometimes the service hangs. So, how can I kill/terminate(not
stop) the process that is hung using a script?My OS is Windows2000. Thanks!
Walker.
“Andreas H?ber” wrote in message news:xxxxx@ntdev…
> Check out the ControlService API which lets you pause, stop etc. a
> service.
> To use it you need to get two handles first:
> 1) For the SCM - use OpenSCManager.
> 2) For the service - use OpenService.
>
> Check out the Platform SDK for more details about it.
>
> Hth,
> Andreas H?ber
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com [mailto:bounce-186506-
> > xxxxx@lists.osr.com] On Behalf Of WalkerNet
> > Sent: Sunday, September 05, 2004 6:23 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] How to kill a service process? Help!
> >
> > I want to kill the service process using a script. I am looking for a
> > solution other than using a 3rd party program (like taskkill.exe or
> > kill.exe).
> > How to do this?
> >
> > Thanks!
> >
> > Walker.
> >
> >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@frisurf.no
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@frisurf.no
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
I ever meet a Trojan-Horse, it registered as a Service. Although it is
listed in the ‘Service Manager’, but it always cannot be stopped.
However the kill.exe can kill the process, and the speed of termination very
quick. So:
Thanks!
Walker.
“WalkerNet” <walker_net> wrote in message news:xxxxx@ntdev…
> I want to kill the service process using a script. I am looking for a
> solution other than using a 3rd party program (like taskkill.exe or
> kill.exe).
> How to do this?
>
> Thanks!
>
> Walker.
>
>
>
>
></walker_net>
The SDK contains the “kill” sources as sample somewhere in
…\SdkTools\TList . That one can Kill winlogon.exe on W2k ![]()
Christiaan
----- Original Message -----
From: “WalkerNet” <walker_net>
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, September 06, 2004 11:57 AM
Subject: Re:[ntdev] How to kill a service process? Help!
> I ever meet a Trojan-Horse, it registered as a Service. Although it is
> listed in the ‘Service Manager’, but it always cannot be stopped.
> However the kill.exe can kill the process, and the speed of termination very
> quick. So:
>
> 1) I don’t know how the kill.exe to do this? It can kill the most processes
> and very quick, this is just I want.
> 2) For example: If I want to kill the process of winlogon.exe in
> Windows2000, how I should do that.
>
> Thanks!
>
> Walker.
>
>
> “WalkerNet” <walker_net> wrote in message news:xxxxx@ntdev…
> > I want to kill the service process using a script. I am looking for a
> > solution other than using a 3rd party program (like taskkill.exe or
> > kill.exe).
> > How to do this?
> >
> > Thanks!
> >
> > Walker.
> >
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
></walker_net></walker_net>
AHA! YES! Thank you very much!!
Sincerely,
Walker
“WalkerNet” <walker_net> wrote in message news:xxxxx@ntdev…
> I want to kill the service process using a script. I am looking for a
> solution other than using a 3rd party program (like taskkill.exe or
> kill.exe).
> How to do this?
>
> Thanks!
>
> Walker.
>
>
>
>
></walker_net>