On Oct 25, 5:59*pm, Gary''s Student
<GarysStud...@xxxxxx> wrote:
> Thank you!
> --
> Gary''s Student - gsnu200810
>
>
>
> "Pegasus (MVP)" wrote:
>
> > "Gary''s Student" <GarysStud...@xxxxxx> wrote in message
> >news:ACABF4AB-95D0-4D1B-8CA7-990A181E32B8@xxxxxx
> > > For debugging, I have a standard set of services and startup programsI
> > > want
> > > to disable. >
> > > Is there any way to drive this with a script rather than manually clearing
> > > a
> > > bunch of checkboxs each time??
> > > --
> > > Gary''s Student - gsnu200810 >
> > You can use sc.exe to enable/disable services.- Hide quoted text - >
> - Show quoted text -
Here's what I have in our startup script...
' ***** SMS Client *****
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2")
Set objShare = objWMIService.Get("Win32_Service.Name='CcmExec'")
Set objInParam =
objShare.Methods_("ChangeStartMode").inParameters.SpawnInstance_()
objInParam.Properties_.Item("StartMode") = "Automatic"
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='CcmExec'",
"ChangeStartMode", objInParam)
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='CcmExec'",
"StartService")
' ***** Trend Personal Firewall *****
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2")
Set objShare = objWMIService.Get("Win32_Service.Name='TmPfw'")
Set objInParam = objShare.Methods_("ChangeStartMode"). _
inParameters.SpawnInstance_()
objInParam.Properties_.Item("StartMode") = "Automatic"
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='TmPfw'",
"ChangeStartMode", objInParam)
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='Tmpfw'", "StartService")
' ***** TMPROXY *****
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2")
Set objShare = objWMIService.Get("Win32_Service.Name='tmproxy'")
Set objInParam =
objShare.Methods_("ChangeStartMode").inParameters.SpawnInstance_()
objInParam.Properties_.Item("StartMode") = "Automatic"
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='tmproxy'",
"ChangeStartMode", objInParam)
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='Tmproxy'",
"StartService")
' ***** Trend Real-Time Scan SERVICE *****
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2")
Set objShare = objWMIService.Get("Win32_Service.Name='NTRTScan'")
Set objInParam =
objShare.Methods_("ChangeStartMode").inParameters.SpawnInstance_()
objInParam.Properties_.Item("StartMode") = "Automatic"
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='NTRTScan'",
"ChangeStartMode", objInParam)
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='NTRTScan'",
"StartService")
' ***** Trend Listener SERVICE *****
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2")
Set objShare = objWMIService.Get("Win32_Service.Name='TMListen'")
Set objInParam =
objShare.Methods_("ChangeStartMode").inParameters.SpawnInstance_()
objInParam.Properties_.Item("StartMode") = "Automatic"
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='TMListen'",
"ChangeStartMode", objInParam)
Set objOutParams =
objWMIService.ExecMethod("Win32_Service.Name='TmListen'",
"StartService")
'***********************************************************
Set WshShell = WScript.CreateObject("WScript.Shell")
objProcess.Create "%comspec% /C sc failure tmproxy reset= 0 actions=
restart/0 _
& sc failure tmlisten reset= 0 actions= restart/0 & sc failure tmpfw
reset= 0 _
actions= restart/0 & sc failure ntrtscan reset= 0 actions= restart/0 &
sc failure ccmexec _
reset= 0 actions= restart/0 & sc failure KBOXManagementService reset=
0 actions= _
restart/0 & sc failure KBOXSMMPService reset= 0 actions= restart/0",
null, objConfig, intProcessID
It works perfect.