Stop and Disable Service Using a Script?

  • Thread starter Thread starter K
  • Start date Start date
K

K

As the title says, is it possible to stop and disable a service in XP using
a script? And if so can someone point me in the right direction for syntax.

Thanks
 
net start {servicename}
or net stop {servicename}

will control a service from a batch file.

The {servicename} is found in services.msc. Note that it is NOT the verbose
name you see in the listing, but the one in the properties window.

AFAIK NET.EXE doesn't allow you to disable or de-register a service. To do
this programmatically you can use a .reg file (the services are
straightforward registry keys) or AutoIt has extensions for this purpose.
http://www.autoitscript.com
 
K said:
As the title says, is it possible to stop and disable a service in XP
using a script? And if so can someone point me in the right direction for
syntax.

Thanks

To start/stop a service: See Anteaus' reply.
To enable/disable a service:

sc config messenger start= demand

sc config messenger start= disabled
sc config /? (to get help)
Watch out for the space following the "="!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top