Hello,

Perhaps I'm using the wrong string to search Google or this group but
is there any way to change a Windows service type from manual or
disbled startup to automatic with vbscript?

Thanks!

Re: changing a service type from manual or disbled startup to automatic by Matthias

Matthias
Fri Jan 28 14:02:15 CST 2005

Adam Sandler wrote:
> Hello,
>
> Perhaps I'm using the wrong string to search Google or this group but
> is there any way to change a Windows service type from manual or
> disbled startup to automatic with vbscript?
>

Torgeir posted just yesterday a nice script in the thread :
deactivate service Message-ID: <Oj#LG2KBFHA.3824@TK2MSFTNGP10.phx.gbl>

HTH

--
Gruesse Greetings Saludos Saluti Salutations
Matthias
---------+---------+---------+---------+---------+---------+---------+

Re: changing a service type from manual or disbled startup to automatic by Torgeir

Torgeir
Fri Jan 28 14:05:33 CST 2005

Adam Sandler wrote:

> Perhaps I'm using the wrong string to search Google or this group but
> is there any way to change a Windows service type from manual or
> disbled startup to automatic with vbscript?
Hi

See e.g. function ConfigureService here (using ADSI's WinNT provider):

http://groups.google.co.uk/groups?selm=Oj%23LG2KBFHA.3824%40TK2MSFTNGP10.phx.gbl


Other VBScript examples manipulating services using ADSI or WMI:
http://groups.google.co.uk/groups?selm=3F4947CC.7CC40904%40hydro.com

Manipulating services using command line utilities:
http://groups.google.co.uk/groups?selm=40047A45.6FB64657%40hydro.com



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: changing a service type from manual or disbled startup to automatic by Adam

Adam
Wed Feb 09 09:08:19 CST 2005

I don't want to do anything with the service other than change it's
startup type from disabled to automatic...

If oService.StartType = ADS_SERVICE_DISABLED Then
oService.StartType = ADS_SERVICE_DEMAND_START
oService.SetInfo
WScript.Sleep 1000
End If

Does ADS_SERVICE_DEMAND_START the same thing as seeing startup type
automatic when viewed from the MMC then?


Re: changing a service type from manual or disbled startup to automatic by Torgeir

Torgeir
Wed Feb 09 09:30:39 CST 2005

Adam Sandler wrote:

> I don't want to do anything with the service other than change
> it's startup type from disabled to automatic...
>
> If oService.StartType = ADS_SERVICE_DISABLED Then
> oService.StartType = ADS_SERVICE_DEMAND_START
> oService.SetInfo
> WScript.Sleep 1000
> End If
>
> Does ADS_SERVICE_DEMAND_START the same thing as seeing startup
> type automatic when viewed from the MMC then?
>
Hi

The code above checks if the startup type of the service is set to
disabled, and if it is, the script will change it to Automatic
(as viewed from the MMC).



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx