cmd查询某进程的父进程的PID

根据进程名来查询父进程的PID

1
wmic process where Name="进程名.exe" get ParentProcessId

根据进程的PID来查询父进程的PID

1
wmic process where ProcessId=PID get ParentProcessId