Monday, March 15, 2010

Tasklist and Taskkill in Windows to list the running process and kill required one

These are command line tools/Utility by windows for viewing all the running process from command prompt and then if any of the process is hanged or if you want to kill any one then that can also be done.

TaskList:

TASKLIST [/S system [/U username [/P [password]]]]
         [/M [module] | /SVC | /V] [/FI filter] [/FO format] [/NH]

Description:
    This command line tool displays a list of application(s) and associated task(s)/process(es) currently running on either a local or remote system.

Examples:
    TASKLIST
     TASKLIST /V
    TASKLIST /SVC : Displays services in each processes
    TASKLIST /S system12 /U domain\username /FO LIST : shows processes running in a remote system in list format
    TASKLIST /FI "IMAGENAME eq cmd.exe"


TsKill:
Ends a process.

TSKILL processid | processname [/SERVER:servername] [/ID:sessionid | /A] [/V]

Examples: TSKILL notepad.exe

TaskKill : This is a advanced form of TsKill utility.
 
TASKKILL [/S system [/U username [/P [password]]]]
         { [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]

Description:
    This command line tool can be used to end one or more processes.
    Processes can be killed by the process id or image name.

NOTE: Termination of remote processes will always be done forcefully
      irrespective of whether /F option is specified or not.

Examples:
    TASKKILL /F /IM notepad.exe /T
    TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
    TASKKILL /F /IM notepad.exe /IM mspaint.exe

No comments:

Post a Comment