본문 바로가기

WebServer-IIS

cmd taskkill 사용법

728x90
반응형

Microsoft Windows [Version 10.0.17134.285]

(c) 2018 Microsoft Corporation. All rights reserved.

 

C:\Users\hazppyzoo>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 terminated.

                           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(es).

    /?                     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 applied.

    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*"




프로세스 죽이기 셈플
TASKKILL /IM notepad.exe
- 노트패트 프로세스 종료
TASKKILL /PID 6224 /PID 4716 /T
- 프로세스ID 6224 4716 + 자식프로세스 전부 죽이기



 

* 디버깅모드 프로세스는 죽일수 없고, 정상적인 프로세스만 죽일수 있다.
* 메모리에서 직접 죽이는 방법도 있음(가장강력 WMIC)
- WMIC process where name='myprogram.exe' delete






* 참고 URL
https://m.blog.naver.com/PostView.nhn?blogId=afidev&logNo=20189044670&proxyReferer=https:%2F%2Fwww.google.com%2F

728x90
반응형