All,
I have searched the repository for a method of closing an open application (Chrome). Code is below. I am stuck on two issues:
1. I am getting a Not Found error on Line 9, Char 6. Code: 80041002, Source: SWbemObjectEx. I'm new to VBS and am not sure what this means. The script DOES close Chrome, but also gives me this error.
2. Upon restarting Chrome, there is the notice that Chrome did not shut down correctly. Is there anyway to eliminate this?
I am trying to complete automate some tasks, and need zero user interaction.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Chrome.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
NextI appreciate your help.