Error DataBase-One Place all Solutions Forums Blog Glossary    Contact Us
Search  
   
Browse by Category
Error DataBase-One Place all Solutions .: Operating Systems .: Windows Operating Systems .: Windows Scripts and Batch Files .: VB Sript to set SERVICE STARTUP TYPE TO AUTOMATIC

VB Sript to set SERVICE STARTUP TYPE TO AUTOMATIC

Here is the VB Script to set the service startup type to Automatic

 

 

strSvcName = "APPMGMT" ' Service Name
strStartupType = "Automatic" ' can be "Automatic", "Manual", or "Disabled"
strComputer = "TFBLRTILT00111" ' Node Name
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set objService = objWMI.Get("Win32_Service.Name='" & strSvcName & "'")
intRC = objService.Change(,,,,strStartupType)
' can alternatively use objService.ChangeStartup(strStartupType) method
if intRC > 0 then
 WScript.Echo "Error setting service startup type: " & intRC
else
 WScript.Echo "Successfully set service startup type"
end if


How helpful was this article to you?

Related Articles

article "The best safe effort" attempt to fix Automatic Updates in windows 2003
This is a "best safe effort" attempt...

(No rating)  2-18-2008    Views: 197   
article How to Use Device Manager to Identify the Cause of the Startup Problem
Device Manager displays a graphical view of the...

(No rating)  7-8-2008    Views: 98   
article Script the Startup and Shutdown of VMware Servers
In using VMware Server, sooner or later you...

(No rating)  4-13-2008    Views: 222   

User Comments

Add Comment
No comments have been posted.