Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

CMD useful comands

  • tasklist - To list the tasks running
  • taskkill - To kill a task


Search for a task

C:\>tasklist | find /i "notepad"
notepad.exe                  23512 Console                    2     16,304 K

Kill a task based on its image name.

C:\>taskkill /im notepad.exe
SUCCESS: Sent termination signal to the process "notepad.exe" with PID 23512.

Search for a port and PID of the task associated with it.

C:\>netstat -aon | find /i ""
  TCP     ESTABLISHED     17404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment