$list = ProcessList()
For $i = 1 To $list[0][0]
If StringRegExp($list[$i][0], '^(wx1\.exe|xw\.exe|msg\.exe)$') Then ContinueLoop
If StringInStr(Procespath($list[$i][1]), "C:\Program Files\wx") > 1 Then
ProcessClose($list[$i][1])
If ProcessExists($list[$i][1]) Then RunWait(@SystemDir & "\ntsd.exe -c q -p " & $list[$i][1], "", 0)
EndIf
Next
Func Procespath($pid)
$strComputer = "."
$objWMIService = ObjGet("winmgmts:\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE ProcessId = " & $pid)
For $objItem In $colItems
$cmdpath = $objItem.CommandLine
$exepath = $objItem.ExecutablePath
$path = StringSplit($cmdpath, "")
If $path[0] <= 2 Then Return $exepath
Return $cmdpath
Next
EndFunc ;==>Procespath
|