Re: Automation Question: How do you stop a process from a .bat fil
  Home FAQ Contact Sign in
microsoft.public.windowsxp.customize only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Automation Question: How do you stop a process from a .bat fil         

Group: microsoft.public.windowsxp.customize · Group Profile
Author: ju.c
Date: Aug 6, 2008 00:25

Try using "sc stop" instead of "net stop".

For processes:

ProcessUtility 2.03
2003 Craig Peacock
http://www.beyondlogic.org

Command Line Process Viewer/Killer/Suspender

Usage:

ProcessUtility.exe [-v] [-t] [-c]
ProcessUtility.exe [-q] [Process Name/PID] [timeout sec(optional)]
ProcessUtility.exe [-k] [-s] [-r] [Process Name/PID]
ProcessUtility.exe [-p] [Process Name/PID]
{RealTime|High|AboveNormal|Normal|BelowNormal|Low}
ProcessUtility.exe [-a] [Process Name/PID] [Mask(To Set)]

-v View Processes.
-t View Kernel and User CPU Times.
-c View Process Creation Times.
-q Send WM_CLOSE Message. Default timeout is 60 Sec
-k Kill Process. (Terminate)
-s Suspend Process.
-r Resume Suspended Process.
-p Set Process Priority.
-a Get/Set Affinity Mask of Process.

PROCUTIL -q [PID] 5

ju.c

"mickey" discussions.microsoft.com> wrote in message
news:2ED7B32C-5847-4C11-A087-18330C17AF4E@microsoft.com...
> I verified that XNETS is the name of the service, which does work in the
> script file.
>
> Thanks for your suggestion.
>
> Mick
>
> "Klaus Jorgensen" wrote:
>
>> mickey laid this down on his screen :
>>> I have created a .bat file that successfully launches the application,
>>> however I can't seem to stop the service.
>>>
>>> The command I'm using is NET STOP service, but no matter how I reference the
>>> service I get an error. The name of the service is XNETS.exe
>>>
>>> Here's what I've tried:
>>> NET STOP XNETS.exe; error can find service
>>>
>>
>> XNETS.exe is the name of the executable - not necessarily the service
>> name. The service name is shown in the list of services; right-click on
>> a service and click properties, then the service name (and it's display
>> name) is shown. If the service name has blanks in it, you'll have to
>> use double quotation marks in the "net stop" command - e.g.:
>> net stop "service name"
>>
>> --
>> /klaus
>>
>>
>>
no comments
diggit! del.icio.us! reddit!