Hi I'm trying to make a VBScript that would terminate a windows service/application at a given time like set the script to do it every sunday.
However the script I'm using right now won't terminate the service/application I want, but it works at terminating other programs I've tried like calculator and etc.
However the script I'm using right now won't terminate the service/application I want, but it works at terminating other programs I've tried like calculator and etc.
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'OMNIS7.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next