Ryan Dao
(Fresh Scripter)
2003-10-02 11:48 PM
How to change service startup type

Hi,

I was wondering if there is a way to change the service startup type. For example, change Automatic Updates service to manually start instead of automatically starting.

Thanks.


ShawnAdministrator
(KiX Supporter)
2003-10-02 11:54 PM
Re: How to change service startup type

Hi Ryan, use or pick apart ServiceMode()

-Shawn

[ 02. October 2003, 23:55: Message edited by: Shawn ]


Ryan Dao
(Fresh Scripter)
2003-10-03 05:04 AM
Re: How to change service startup type

Thanks for the help. Is there an easier way? Any way to use a command line using a utility?

Thanks,

Ryan


Les
(KiX Master)
2003-10-03 05:05 AM
Re: How to change service startup type

Commandline util... blasphemy!

This is a KiX board!


Howard Bullock
(KiX Supporter)
2003-10-03 05:06 AM
Re: How to change service startup type

What could be easier than using a simple pre-written canned UDF: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000204

[ 03. October 2003, 05:07: Message edited by: Howard Bullock ]


ShawnAdministrator
(KiX Supporter)
2003-10-03 05:08 AM
Re: How to change service startup type

ja, check out the SC util from the NT/2K RESKIT.

Howard Bullock
(KiX Supporter)
2003-10-03 05:11 AM
Re: How to change service startup type

Blasphemer!

Why not use the GUI then!?


Les
(KiX Master)
2003-10-03 05:13 AM
Re: How to change service startup type

It would be easier to use the UDF than to code SC into KiX!

ShawnAdministrator
(KiX Supporter)
2003-10-03 05:13 AM
Re: How to change service startup type

Agreed, Ryan - I recommend you use the GUI to do this as it would definitely be the easiest way.

Howard Bullock
(KiX Supporter)
2003-10-03 05:19 AM
Re: How to change service startup type

Ryan, you can thank Shawn for this one: http://www.petri.co.il/download_free_reskit_tools.htm

[ 03. October 2003, 05:20: Message edited by: Howard Bullock ]


ShawnAdministrator
(KiX Supporter)
2003-10-03 05:22 AM
Re: How to change service startup type

Actually Ryan, that is a very cool site to bookmark ... its got all the neat 2K reskit tools for download on one nice page ... hope it helps ...

Ryan Dao
(Fresh Scripter)
2003-10-03 05:49 AM
Re: How to change service startup type

Thanks Shawn and everyone else for helping. Will try and let everyone know.

Sealeopard
(KiX Master)
2003-10-03 04:19 PM
Re: How to change service startup type

Actually, there are a couple of 'service control' UDFs in the UDF forum that use various means to control services. Just use the one that suits your needs and don't forget to read the fAQ forum on how to use UDFs.

BTW, it is normally not necessary to custom modify UDFs, though if you have improvements, the UDF writers are normally more than willing to improve the UDF in question.


Ryan Dao
(Fresh Scripter)
2003-10-04 01:58 AM
Re: How to change service startup type

Found the registry setting for it.

hklm\system\currentcontrolset\services\servicename\startup, change it to 3 for manual start.

Go to here for more info.
http://support.microsoft.com/default.aspx?scid=kb;en-us;248660

Thanks again for everyone's help


Howard Bullock
(KiX Supporter)
2003-10-04 02:00 AM
Re: How to change service startup type

Good follow-up Ryan. Doing research is the first step to providing good solutions.

Sealeopard
(KiX Master)
2003-10-04 02:33 AM
Re: How to change service startup type

The ServiceMode() - Checks/sets the startup mode of a service UDF is using this type or registry key/value manipulation to get/set the service startup mode.

NTDOCAdministrator
(KiX Master)
2003-10-04 02:47 AM
Re: How to change service startup type

Well I see Jens pointed you to a UDF that does it via that method already.
Here is the MSKB article though for manipulating the Automatic Updates
as well as a trimmed down version of Jens UDF.





; Microsoft Knowledge Base Article - 328010
; How to Configure Automatic Updates by Using Group Policy or Registry Settings
; http://support.microsoft.com/?kbid=328010

SetServiceMode(,'Norton AntiVirus Server',2)
? 'Return value for updating key: '+@error+' '+@serror

Function SetServiceMode(optional $RemotePC,$Service,$StartValue)
DIM $SetMode
if len($RemotePC) $RemotePC=iif("\\"=left($RemotePC,2),$RemotePC,"\\"+$RemotePC)+"\" endif
$SetMode=writevalue($RemotePC+'HKLM\SYSTEM\CurrentControlSet\Services\'+$Service,'Start',$StartValue,'REG_DWORD')
EndFunction



[ 04. October 2003, 19:21: Message edited by: NTDOC ]


Ryan Dao
(Fresh Scripter)
2003-10-04 03:24 AM
Re: How to change service startup type

This forum has the best and faster replies of all the forum I've used. Including MS's forum. Thanks again for all the help and hope I can help in the future.

Ryan


Les
(KiX Master)
2003-10-04 02:56 PM
Re: How to change service startup type

Ryan,
I still fail to understand why you would not use one of the UDFs suggested. Far easier than finding the reg key and hacking the reg.


Sealeopard
(KiX Master)
2003-10-04 04:25 PM
Re: How to change service startup type

Ryan might not have realized how easy UDFs are to use and what wide selection of UDFs we're offering.