Skip to content

Instantly share code, notes, and snippets.

@jreypo
Last active December 15, 2018 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jreypo/08533bc50da17944cc8f413962d437a2 to your computer and use it in GitHub Desktop.
Save jreypo/08533bc50da17944cc8f413962d437a2 to your computer and use it in GitHub Desktop.

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