KB-38178: Closing a computer’s process via E3

Question:

Can I close a computer’s process via E3?

Solution:

Yes. To do so, you must write a script.

For example:

ProcessName = “notepad.exe”
PID = 2536
Set service = GetObject(“winmgmts:\\.\root\cimv2”)
‘Closes the process via PID (Process ID)
‘Set results = service.ExecQuery(” Select * from Win32_Process where ProcessId =’” & PID & “‘”)
‘Closes by the process’ name
Set results = service.ExecQuery(” Select * from Win32_Process where Name =’” & ProcessName & “‘”)
 
for each obj in results
    obj.Terminate()
    ‘exit sub
next

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *