Saurabh Jain
Saurabh Jain

Reputation: 291

How to retrieve PID of cmd.exe on windows?

How to retrieve PID of cmd.exe on windows?

I am trying to figure out PID for cmd.exe , like in Unix i can get with "ps" command what should be windows equivalent for same?

Upvotes: 3

Views: 14978

Answers (1)

Saurabh Jain
Saurabh Jain

Reputation: 291

tasklist |find "cmd.exe"

will always return you list of cmd.exe with PID

if you wish to know PID of specific terminal then execute from the terminal:-

wmic process get parentprocessid,name|find "WMIC"

WMIC.exe 11348

it should return the parent PID which will always be the PID of your cmd.exe

Upvotes: 17

Related Questions