Kill process with cmd

Page 1 of 2 12 LastLast

  1. Posts : 662
    Windows 7 Home Premium x64, Mac OS X 10.6.2 x64
       #1

    Kill process with cmd


    What would be the command to kill a process like explorer.exe or wininit.exe through cmd?
      My Computer


  2. Posts : 5,642
    Windows 10 Pro (x64)
       #2

    Code:
    C:\Windows\system32>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*"
      My Computer


  3. Posts : 8,679
    Windows 10 Pro x64
       #3

    ^^

    Here's tutorial for that on SF .

    Task Management
      My Computer


  4. Posts : 662
    Windows 7 Home Premium x64, Mac OS X 10.6.2 x64
    Thread Starter
       #4

    When I use taskkill or tasklist to kill a process, it seems to bring up a dialog asking what to do with windows (shutdown, hibernate, logoff etc.) instead of killing the process. Tested with explorer.exe
      My Computer


  5. mjf
    Posts : 5,969
    Windows 7x64 Home Premium SP1
       #5

    what specific process are you trying to kill.
      My Computer


  6. Posts : 662
    Windows 7 Home Premium x64, Mac OS X 10.6.2 x64
    Thread Starter
       #6

    explorer.exe and wininit.exe, separately.
      My Computer


  7. Posts : 5,642
    Windows 10 Pro (x64)
       #7

    You are trying to kill wininit?! Are you trying to BSOD the computer?
      My Computer


  8. Posts : 662
    Windows 7 Home Premium x64, Mac OS X 10.6.2 x64
    Thread Starter
       #8

    Well... not my computer :P
      My Computer


  9. Posts : 1,781
    Windows 7 Professional SP1 32-bit
       #9

    OK, so why do you want to kill wininit.exe? It's a critical system process. If you're issuing a command to shut down this process I'm not surprised that you end up with a standby/shutdown/restart dialog...
      My Computer


  10. Posts : 662
    Windows 7 Home Premium x64, Mac OS X 10.6.2 x64
    Thread Starter
       #10

    Yes, but it did the same thing for explorer.exe and even chrome.exe
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:02.
Find Us