Discussion Locked

Killing Service via Task Manager?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an application that is running several things as services on my W2K Server. I need to stop and restart these services via command line in a batch file but I am unable to do so using NET STOP.

I could use KILL to kill the process in task manager, but will that have an adverse effect on the service or anything?

5 replies

by ezhou

If you use kill the task manager (C:\>kill taskmgr) the windows just close out. So, you can restart it again (C:\>taskmgr). It shouldn't have any effect on the service.
edz

by tscislaw

Thanks for the reply. I figured out why NET STOP wasn't working. I forgot to use quote marks for the services that consist of two seperate words, such as "entercept server".

by ayoshi

the application to properly close it's files that are in use, or clear it's caches, etc... so you have now possibly introduced some corruption into the application that you killed. Do it enough, and you'll start finding out how much data you lost.
I'd like to know why the Net Stop command doesn't work, as that provide a safer solution.

As an alternative, there is a "NETSVC" utility that comes with the NT 4 Server resource kit that might be useful.

by davidpmartin

If you have the NT resource kit installed you can use 'pulist' to find the process number of the offending service, and then use the kill command with the process number as the argument. Then use NET START or the GUI to restart the service.

Works for me every time.

Dave

by swill57

A command line tool that allows you to start, start, and query the state of a service, by name. It can do this remotely as well, via RPC.

Using Sc.exe and Netsvc.exe to Control Services Remotely (Q166819)

This discussion is closed to new replies.