Score:0

How to get PID of an EXE file from Windows command line

ng flag

How do I get the PID of an EXE file from Windows command line?

I want to query the PID from the command line, rather than manually search in Task Manager.

I've found something similar in nix

Score:2
ph flag

PowerShell Get-Process can return the PID of running processes.

❯ Get-Process explorer

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
    135   218.04     218.04     140.12   34304   3 explorer

❯ (Get-Process explorer).Id
34304

Documentation

Score:0
in flag

In unlikely event that you don't want PowerShell then there is also tasklist

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.