thudo 0 Posted January 10, 2013 Report Share Posted January 10, 2013 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!!! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.