Jump to content

thudo

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by thudo

  1. Is this possible? I want to target a specific process name running under its parent and nothing more.I figured this would work:

    Function KillProcessInProcess()strComputer = "."Set objWMIService = GetObject("winmgmts:" _    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colProcessList = objWMIService.ExecQuery _    ("SELECT * FROM Win32_Process WHERE Name = 'CcmExec.exe' OR Name = 'wscript.exe'")For Each objProcess in colProcessList    objProcess.Terminate()NextEnd Function

    The problem is it will also kill all other wscript.exe process running as well as the CcmExec.exe process itself for some reason during our SMS deployment.We just want the single wscript.exe child process running under CcmExec.exe to be killed. Its PID will be random so no sense doing it via PID. Anyone have a solution? Thank you Community!!!

×
×
  • Create New...