Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

CMD useful comands

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

Examples

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 "192.168.1.34:62583"
  TCP    192.168.1.34:62583     168.62.106.216:443     ESTABLISHED     17404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment