Discussion Locked

Enable Disabled service remotely CMDline

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I need to know if there is a NET, NETSVC or SC or other command line function that can set a disabled service to Automatic and set the state to started.

3 replies

by beermonster

Hi,
I'm not sure about a single util, but here's what I'd try (in fact theres a few ways of doing this but this is the easiest).
to set the service startup parameter, use reg.exe to modify the 'start' value of the service. this can be found inhklm\system\currentcontrolset\services\yourservicename.

a value of 4 is disabled
a value of 2 means auto

next use netsvc (or equivelant) to remotely start the service. Place hese two steps in a batch file and the jobs done. hope this helps...

by prescott.small

This solution would work and we had already thought of this. We knew there was a simpler way but none of my team could remember the command This more than what we wanted to do. Good eye though.

Found it after hours of digging. This one is not documented in the MS website or the text files in the NT 4 resource kit.

Took some interpretation of the following Article about creating and starting a service:
http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q251192

Sc config SERVICENAME start= auto

The space after the = sign is required.

Change the SERVICENAME to what ever the name is of the service that shows up in the services.msc window.

This discussion is closed to new replies.