Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable a service with VBS

Status
Not open for further replies.

Niavlys

IS-IT--Management
Jun 3, 2002
197
CA
Hi, I need to disable a service for preventing it to start up automatically on boot. I can stop that service but I can't figure out how to disable it.
Code:
Set oService = GetObject("WinNT://" & strComputer & "/" & strService1 & ",Service")

If Err.Number <> 0 Then
	WScript.Echo &quot;Service already stopped.&quot;
  Else	
	oService.Stop
End If

There is oService.StartType that gives me the start type but can't seem to change it.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top