thudo Posted January 10, 2013 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!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now