I am trying to create a script that will kill a process based on the process
name which is passed to the script as a cli argument. The following code
snippet works fine if the process name is hardcoded in the script, but I
can't assign the process name to a variable and use that in the ExecQuery
command.
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'AIM.EXE'")
I would rather use WHERE Name= variable