I am trying to do a script that'll allow me to kill a few processes when I need a maximum of resources. Things I don't mind starting up when I start XP (dropbox, PowerISO, OpenOffice-tray, etc.) but since they all eat a little memory each I'd like to create a script that terminates them all by one click.
Now my problem is SQL-related. I have a script that will terminate a single process looking like this:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'PWRISOVM.EXE'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
But I can't, for the life of me, make the SELECT statement grab more than a single process. If anybody can enlighten me on this I'll be very happy :-)
