Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
InfrastructureJuniorOccasionalPractical

How do you list and stop processes from Windows command line?

Answer

In Command Prompt, `tasklist` lists processes and `taskkill` can terminate them by PID or image name. In PowerShell, `Get-Process` returns process objects and `Stop-Process` terminates selected processes. Prefer identifying the exact PID and verifying the process before using force, especially on shared test machines.

Strong answer includes

  • tasklist and taskkill are CMD-native tools
  • Get-Process and Stop-Process are PowerShell cmdlets
  • verifies PID or process identity before termination

Practical example

Use `tasklist /fi "IMAGENAME eq java.exe"` to narrow candidates, then `taskkill /PID 4321` for the confirmed process. In PowerShell, `Get-Process java` provides object properties before `Stop-Process -Id 4321`.

#windows#processes#tasklist#powershell

Sources

Windows commands referenceMicrosoft · Command Prompt utilities including ipconfig, netstat, tasklist, taskkill, sc, findstr, ping, tracert and nslookupPowerShell documentationMicrosoft · PowerShell cmdlets, object pipeline, processes, services, networking, event logs and environment handlingPowerShell Interview QuestionsWeCP · Recurrence signal for PowerShell fundamentals, cmdlets, services, processes, pipelines and troubleshooting questions