Given a process ID & command-line access on a remote Windows host, how can you find its parent\'s PID?
Given Marc B\'s answer,
Based on joslinm's solution in the question, here's a snippet of how to use this in a batch script:
set PID= for /f "usebackq tokens=2 delims==" %%a in (`wmic process where ^(processid^=%PID%^) get parentprocessid /value`) do ( set PARENT_PID=%%a )