Wednesday, October 15, 2008

VBS for NT services installation


Install/Uninstall by Name:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("SELECT * FROM Win32_Service WHERE Name = 'IA DB Logging'")
For Each objService in colListOfServices
objService.StopService()
objService.Delete()
Next

Install by source exe
DIM objShell
set objShell = wscript.createObject("wscript.shell")
iReturn = objShell.Run("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installUtil IACalcDaemon.exe")

No comments: