Kill Processes from Command Promt
Open up an Administrative level Command Prompt and run tasklist to see all of the running processes:
C:\>tasklist
In the example above you can see the image name and the PID for each process. If you want to kill the firefox process run:
C:\>Taskkill /IM firefox.exe /F
orC:\>Taskkill /PID 2200 /F
The /f flag is kills the process forcefully.If you have multiple instances of an image open such as multiple firefox.exe processes, running the taskkill /IM firefox.exe command will kill all instances. When you specify the PID only the specific instane of firefox will be terminated. The real power of taskkill are the filtering options that allow you to use the following variables and operators.
Variables:
- STATUS
- IMAGENAME
- PID
- SESSION
- CPUTIME
- MEMUSAGE
- USERNAME
- MODULES
- SERVICES
- WINDOWTITLE
Operators:
- eq (equals)
- ne (not equal)
- gt (greater than)
- lt (less than)
- ge (greater than or equal)
- le (less than or equal)
- "*" is the wildcard.
C:\>taskkill /FI "WINDOWTITLE eq Internet*" /F
How about killing all processes running under the Shawn account:
C:\>taskkill /FI "USERNAME eq Shawn" /F
It is also possible to kill a process running on a remote computer with taskkill. Just run the following to kill notepad.exe on a remote computer called ShawnDesktop:C:\>taskkill /S ShawnDesktop /U RemoteAccountName /P RemoteAccountPassword /IM notepad.exe /F
To learn more about taskkill run it with the /? command just like any other Windows command.
Source
0 comments:
Post a Comment