Reputation: 2425
It is save to terminate the services using taskkill when the attempt to stop using NET STOP was failed? And if i terminate it using taskkill, do NET START command will affect or do i need to use START command?
consider this code as example:
@ECHO OFF
:STOP
NET STOP someservices
IF ERRORLEVEL == 0 GOTO :START
GOTO :KILL
:START
NET START someservices
:KILL
TASKKILL /F /IM someservices.exe
SLEEP 10
START someservices.exe
Upvotes: 1
Views: 1520
Reputation: 106549
Use SC instead of NET -- it won't fail.
Billy3
EDIT: And you will have difficulty killing a fair number of services which can share the same process. EDIT2: See this for more details -> http://support.microsoft.com/kb/314056
Upvotes: 1