PID of the last running process on Windows

I want to grep the PID of the last running process on Windows. I am executing a command in the background.

  • start "Window name" / b "c: \ Program Files \ Wireshark \ tshark.exe" -i 1 -w file1.pcap
  • start "Window name" / b "c: \ Program Files \ Wireshark \ tshark.exe" -i 1 -w file2.pcap

How to get the PID of these commands?

+5
source share
2 answers

Perhaps by tracking them.

, tasklist (. tasklist /?), PID, . ( tasklist FOR /F, . FOR /? .)

, , , PID (, FIND /V, . FIND /? ), PID. , , , .

+3

wmic pid. , , .

+2

All Articles