VBS脚本:
Set wmi = GetObject("winmgmts:\\.")
Set pro = wmi.instancesof("win32_process")
for each p in pro:
print p.name
if p.name = "UFT.exe" then p.terminate
Next
Python脚本:
c = wmi.WMI()
for process in c.Win32_Process():
print process.ProcessId,
print process.Name
result = process.Terminate()