Results 1 to 2 of 2

Thread: How to kill multiple instances of a command

  1. #1
    Join Date
    May 2008
    Posts
    176

    How to kill multiple instances of a command

    The command prompt, and resurgence of a glorious past, devoid of computer graphics interface, has dozens of orders, some of which have no equivalent Windows. This is particularly true of Taskkill, a very handy command to kill some more instances of the same program.


    Taskkill is one of the commands that the system particularly so terribly misunderstood and practice daily.

    Taskkill allows the command to kill all tasks meet the criterion of selection. Since it is not uncommon to find half planted with several instances of one application in memory (typically explorer.exe, iexplore.exe, svchosts.com, outlook.exe, etc..), This command allows give a quick clean up the process started without having to kill them one by one, through the Windows Task Manager.

    The command Taskkill works with the TaskList which takes roughly the same parameters. TaskList list active processes in memory. It is therefore advisable to test first on TaskList the selection parameters that you intend to use on Taskkill.

    The commands have the following form:

    Code:
    TaskList / FI "filter"
    Code:
    TASKKILL / FI "filter" / IM name / T / F
    In these commands "filter" is expressed as:

    COMMAND Operator Values
    STATUS eq, ne RUNNING / NOT RESPONDING / UNKNOWN
    ImageName eq, ne name of the process
    PID eq, ne, gt, lt, ge, Value of the PID of process
    SESSION eq, ne, gt, lt, ge, le Session number
    SESSIONNAME eq, ne Session name
    CPUTIME eq, ne, gt, lt, ge, le CPU time (hh: mm: ss)
    MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
    SERVICES eq, ne Service name
    WINDOWTITLE eq, ne Window title
    MODULES eq, ne DLL name

    The meaning of the operators is as follows:

    eq = Equal to
    ne = Not equal to
    gt = Greater than
    ge = Greater than or Equal to
    lt = Less than
    le = Less than or Equal to

    Thus:

    Code:
    TaskList / FI "STATUS eq NOT RESPONDING"
    list all processes that seem planted.

    Code:
    TASKKILL / FI "STATUS eq NOT RESPONDING" / F / T
    kills all processes that seem planted.

    Also:

    Code:
    TaskList / FI "MEMUSAGE gt 300000"
    list all processes which exceeds the memory greater than 300 MB

    Code:
    TASKKILL / FI "MEMUSAGE gt 300000" / F / T
    kill all processes which exceeds the memory greater than 300 MB

    Or:

    Code:
    TaskList / FI "CPUTIME gt 00:10:00"
    list all processes whose CPU occupancy exceeds 10 minutes

    Code:
    TASKKILL / FI "CPUTIME gt 00:10:00"
    kill all processes whose CPU occupancy exceeds 10 minutes

  2. #2
    Join Date
    May 2009
    Posts
    218

    Re: How to kill multiple instances of a command

    Code:
    TaskList / FI "ImageName eq NOTEPAD *"
    list all processes on the Windows Notepad in memory.

    Code:
    TASKKILL / FI "ImageName eq NOTEPAD *"
    Kill all instances of Windows Notepad present in memory.

    Note: In TASKKILL, the command / FI "ImageName eq PROG" is equivalent to / IM PROG

    In other words, the two entries have the same action:
    TASKKILL / FI "ImageName eq IEXPLORE *" / F / T
    TASKKILL / IM IEXPLORE * / F / T
    Warning:

    Under VISTA, you must start the command prompt in "Administrator". Go to the Start menu, then All Programs, then Accessories, right click on Command Prompt and select "Run as administrator". Alternatively, you can use the following shortcut method: Open the Start menu by pressing [Windows], enter CMD in the search field and push simultaneously the [Shift] + [Ctrl] + [Enter].

Similar Threads

  1. Multiple Instances of the same capture card not recognized
    By Austin Covello in forum Hardware Peripherals
    Replies: 1
    Last Post: 08-02-2011, 06:48 AM
  2. Multiple instances of Outlook
    By Zeeman28a in forum Windows Software
    Replies: 3
    Last Post: 29-07-2010, 06:56 PM
  3. Multiple ActiveX instances
    By Wagstafari in forum Operating Systems
    Replies: 2
    Last Post: 23-11-2009, 05:04 AM
  4. Replies: 0
    Last Post: 22-12-2008, 04:52 PM
  5. Running multiple instances of an application
    By DocAtom in forum Vista Help
    Replies: 7
    Last Post: 14-02-2008, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,929,523.35580 seconds with 17 queries