Jump to content

Stop and Disable Service Using a Script?


Recommended Posts

Posted

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

  • Replies 3
  • Created
  • Last Reply
Guest Anteaus
Posted

RE: Stop and Disable Service Using a Script?

 

 

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" wrote:

> 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

>

>

>

Guest Pegasus \(MVP\)
Posted

Re: Stop and Disable Service Using a Script?

 

 

"K" <nospam@nospam.com> wrote in message

news:eDuGNUQ1IHA.5832@TK2MSFTNGP02.phx.gbl...

> 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 "="!

  • 2 weeks later...
Guest Paresler
Posted

Re: Stop and Disable Service Using a Script?

 

 

Check out this URL

'WMI and VBScript - Stop and Start Services with Win32_Service'

(http://tinyurl.com/2kekw4)_

 

 

--

Paresler


×
×
  • Create New...