Kill command in windows

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Kill command in windows

Post by Neo »

Is there a CLI equivalent of the kill command for windows?
I googled for this and got http://www.xmlsp.com/pview/prcview.htm which looks ok.
But I was wondering if therer were any Windows "tricks" to do this?
Only Human
AR

Re:Kill command in windows

Post by AR »

http://www.tech-recipes.com/windows_tips446.html
eg. taskkill /IM "iexplore.exe"
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Kill command in windows

Post by Neo »

Thanks a lot AR.
BTW I think the command is tskill. taskill did not work for me (I think it does for some other versions of windows though)
Only Human
AR

Re:Kill command in windows

Post by AR »

TASKKILL works on WindowsXP, don't know about other versions (Note that there are 2 Ks, not one)
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Kill command in windows

Post by Neo »

Oh! I was trying out "TASKILL" (missed a K there).
Yeah it does work but "TSKILL" looks like it has more options.
Only Human
Tora OS

Re:Kill command in windows

Post by Tora OS »

Neo wrote: Oh! I was trying out "TASKILL" (missed a K there).
Yeah it does work but "TSKILL" looks like it has more options.

Code: Select all

C:\Documents and Settings\Administrator>TSKILL /?
Ends a process.

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

  processid           Process ID for the process to be terminated.
  processname         Process name to be terminated.
  /SERVER:servername  Server containing processID (default is current).
                         /ID or /A must be specified when using processname
                         and /SERVER
  /ID:sessionid       End process running under the specified session.
  /A                  End process running under ALL sessions.
  /V                  Display information about actions being performed.
[hr]

Code: Select all

C:\Documents and Settings\Administrator>TASKKILL /?

TASKKILL [/S system [/U username [/P [password]]]]
         { [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]

Description:
    This tool is used to terminate tasks by process id (PID) or image name

Parameter List:
    /S    system           Specifies the remote system to connect to.

    /U    [domain\]user    Specifies the user context under which the
                           command should execute.

    /P    [password]       Specifies the password for the given user
                           context. Prompts for input if omitted.

    /FI   filter           Applies a filter to select a set of tasks.
                           Allows "*" to be used. ex. imagename eq acme*

    /PID  processid        Specifies the PID of the process to be terminat
                           Use TaskList to get the PID.

    /IM   imagename        Specifies the image name of the process
                           to be terminated. Wildcard '*' can be used
                           to specify all tasks or image names.

    /T                     Terminates the specified process and any
                           child processes which were started by it.

    /F                     Specifies to forcefully terminate the process(e

    /?                     Displays this help message.

Filters:
    Filter Name   Valid Operators           Valid Value(s)
    -----------   ---------------           -------------------------
    STATUS        eq, ne                    RUNNING |
                                            NOT RESPONDING | UNKNOWN
    IMAGENAME     eq, ne                    Image name
    PID           eq, ne, gt, lt, ge, le    PID value
    SESSION       eq, ne, gt, lt, ge, le    Session number.
    CPUTIME       eq, ne, gt, lt, ge, le    CPU time in the format
                                            of hh:mm:ss.
                                            hh - hours,
                                            mm - minutes, ss - seconds
    MEMUSAGE      eq, ne, gt, lt, ge, le    Memory usage in KB
    USERNAME      eq, ne                    User name in [domain\]user
                                            format
    MODULES       eq, ne                    DLL name
    SERVICES      eq, ne                    Service name
    WINDOWTITLE   eq, ne                    Window title

    NOTE
    ----
    1) Wildcard '*' for /IM switch is accepted only when a filter is appli
    2) Termination of remote processes will always be done forcefully (/F)
    3) "WINDOWTITLE" and "STATUS" filters are not considered when a remote
       machine is specified.

Examples:
    TASKKILL /IM notepad.exe
    TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
    TASKKILL /F /IM cmd.exe /T
    TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
    TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
    TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
    TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"
It looks to me that TASKKILL has more options...

I've used Taskkill various times on TelNet to kill something on my server, or just to play with.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Kill command in windows

Post by Neo »

yup your'e right. :P
Only Human
TheUnbeliever

Re:Kill command in windows

Post by TheUnbeliever »

Taskill - works on XP Home but you have to get it on there - it doesn't ship with it by default, tskill comes with XP Home and Professional.
mystran

Re:Kill command in windows

Post by mystran »

Isn't there also the good old KILL.EXE in some utilities pack or something that you could download from microsoft.
Post Reply