I am writing a batch file to kill all the dependent process for given process ID.I have not completed my code yet.For now my code is
set cmd="wmic process where (ParentProcessId=4192) get ProcessId"
FOR /F %%i IN (' %cmd% ') DO (
SET X=%%i
echo The process is %X%
)
The output of "wmic process where (ParentProcessId=4192) get ProcessId" command is :
ProcessID
3516
<blank space>
In batch it is setting X=ProcessID,3516 and blank space. problem 1: for above code it is not displaying the value of X (in echo). Problem 2: I want those %%i which is integer