technology and zen of life

“I don't suffer from insanity, I enjoy every minute of it” - Edgar Allan Poe

WindowsXP: Using the Command prompt to see and kill processes

If you are a WindowsXP user then you must be already familiar with the life-saving graphical tool called “Task Manager” on Windows. Whenever the PC starts hanging and the processes start eating up a lot of memory (Sadly most of the time its Firefox for me), we press the alt+ctr+del key to bring up the the “Task Manager” and try to kill the memory eating processes and the ones which are “not responding”. Well, you should also know that this can be done efficiently from the command prompt as well by using the task manager command prompt alternative and kill processes from command prompt.

As my project work requires writing and running codes, I generally have at least one Windows command prompt open. If this is the case with you then it is much faster to manage your windows processes from command prompt than to open up the Task Manager, just like we do on Linux using “ps” and “kill” command. Get to know the following commands and you can easily use the command prompt to see and kill processes.

1. Tasklist : This command is similar to “ps” command on Linux and is used to see the details of the programs and processes that are running in Windows. Tasklist can be applied to see how much memory and CPU time running processes are using, what DLL files they rely on, and other information. Thus it can be a very useful troubleshooting tool.trans WindowsXP: Using the Command prompt to see and kill processes

  • Processes info: When you enter tasklist on the command prompt, you can see the following informations by default. Image Name, PID, Session Name, Session#, Mem Usage
  • Processes detailed info: Additional info like, Status, User Name, CPU Time, Window Title can be displayed using tasklist /v
  • Services and Processes info: Use tasklist /svc to get a table relating Image Name, PID, and Services, very useful to know the relationship between a process and the services that are running on a system.
  • dlls and Processes info: Tasks and Use tasklist /m to find which DLLs are used by each process.
  • Filtering processes: Processes can be filtered using ImageName, PID, MemUsage, Status, Username and WindowTitle. For Example,
    • Use the following command to to find processes that are not responding.
      • tasklist /fi "status eq not responding"
    • Use the folliwing to list the processes eating up more than 10MB.
      • tasklist /fi "memusage gt 10000"
  • More Info: To get more info on advanced syntax of the command use tasklist /? or refer to Microsoft’s documentation.

(NOTE: Although Tasklist is a part of Windows XP Professional, it does not come with the Home edition. Those with the Home version of XP can download this file and can put it in the system path.)

2. Tskill : This command is used to end a process, using its name of its PID.

  • Kill with name: Use tskill processname to kill a process with name processname. For example:
    • tskill winword (closes all the Microsoft documents that you have open)
  • Kill with PID : Similarly use tskill processid to kill a process with PID processid. Tasklist can be used to find the PID of a process.
  • More Info: To get more info on advanced syntax of the command use tskill /? or refer to Microsoft’s documentation.

(NOTE: Tskill is a part of both Windows XP Professional and the Home edition.)

3. Taskkill : Similar to Tskill, this command is also used to end a process but it provides us more options in doing so. Apart from specifying the PID or the image name of the process to kill, we can also use ceratin filters to kill the matching processes as explained below.

  • Kill with name: Use taskill /IM imagename to kill a process with the given Image name. For example:
    • taskkill /im notepad.exe /f (forces notepad to be killed.)
  • Kill with PID : Use taskill /PID processid to kill a process with the given processid.
  • Filtering Taskkill: Processes to be killed can be filtered using ImageName, PID, MemUsage, CPUTime, Session, Status, Username, WindowTitle, Services or Modules (dll). For Example,
    • Use the following command to forcefully shut down all the processes that are not responding.
      • taskkill /f /fi "status eq not responding"
    • Use the folliwing to close down all programs using more than 10 MB..
      • taskkill /f /fi "memusage gt 10000"
  • More Info: To get more info on advanced syntax of the command use taskkill /? or refer to Microsoft’s documentation.

(NOTE: Taskkill is only a part of Windows XP Professional.)

So Enjoy using the task manager command line version!

Go on, show the power of your commands to the processes. Happy killing them. icon wink WindowsXP: Using the Command prompt to see and kill processes

(Extra Note (Added for my own safety) : I am not responsible if anything goes wrong, while trying out the commands given here.)

Related posts:

  1. WindowsXP: Useful and Categorized Run commands for daily tasks
  2. Windows : Map a Path to a Drive letter
  3. User Access Control

Category: How to's, Microsoft, Technology, Windows

Tagged:

51 Responses

  1. DarK says:

    hehe.. it helped me in my new DotA.bat file

  2. Prasoon says:

    this one was good :)

  3. Rower93 says:

    will this help me find viruses if i have any?

  4. hyperwired says:

    thanks, very helpful.

  5. DNMurali says:

    Nice to see the requested answer.

  6. Anoop says:

    Hey great one man… just helped us like n e thing.. keep it up.,. thanks

    San

  7. janus says:

    very good man!!! keep it up…

  8. yogi says:

    good article :) .

  9. amrishwa bihari says:

    hmm nice i will create a .net application for this killing of process

  10. Shwet says:

    Lol…. writing it in vb is very simple…
    u need to use

    Shell(“TaskKill [Options] Processname”)

  11. Rex says:

    tnx a lot.. more power..

  12. Alireza says:

    thanks man! it helped me kill a virus that used to hide itself in the task manager, it seems that they cant hide themselves in cmd! ;)

  13. Sarav says:

    How can i use CPUTIME in taskkill.
    Can anyone please give me an example.
    Is it possible to kill a task according to the system time?
    Thanks

  14. shajid says:

    Hi,

    This helpful for me…. Good… But i need some more help….. that…. If we give PID i need some CPU utilization in percentage as it is in taskManager….
    If i can get atleast CPU memory from dos prompt, that will be helpful for me…..

    My mailID is: shajid4u@gmail.com

    Thanks in Advance…

  15. Renjith says:

    Hello
    Thanks a lot
    Really Hats Off. I was struggling a lot from past two months with firefox hang problem . task manager was not there since i am using citrix.

  16. John says:

    Thanks! I had an interesting scenario where these instructions helped alot. On my XP workstation in San Francisco, OUTLOOK.EXE couldn’t be closed. Problem was: I was in New Hampshire on an XP laptop, with a Remote Connection (through a VPN) from the laptop to the workstation. While viewing my remote workstation, I tried using Ctrl-Alt-Del to bring up Task Manager, but … it was showing me the processes/tasks on my local laptop. A Google search got me to your page. As instructed, I opened a DOS box on the workstation, used the tasklist command to find the pid for OUTLOOK, then tskill . Problem solved. Many thanks.

  17. MikeA says:

    John,

    While in a remote session, CTRL+ALT+END will also get you to the remote Task Manager…

  18. John says:

    why do you people all seem stupid and fake?

  19. Fr0z3n says:

    Cause we are.

    You think that’s air you are breathing?

  20. Abbas says:

    i double clicked the virus file. it began to run and task manager is not opening. how to stop the process through command prompt

  21. ss says:

    Thanks man Its rally help for killing processes

  22. phoephoe9 says:

    Thanks a lot.

  23. aravind says:

    hi,
    need a solution to list all the processes which are in fact viruses.

    thanks in advance.
    Aravind

  24. wow says:

    for all of you using remote computers and not knowing how to get to the task manager… wow. ctrl + alt + end *or* right click on the task bar -> task manager. and for everyone who think this helped them “kill a virus”, you still have them. I don’t even know what to say to ‘aravind’ other than “wow I can’t believe anyone is that stupid”.

  25. lafftar says:

    thanks dude it really helped but it says access denied wen i tried closing xtrap

  26. Prabhu says:

    Awesome. Some times the taskmanager will not be opening when the system hangs. I usually try for some time and then i reboot the machince. This really helps me.

  27. mike says:

    this is so amazing. thanks. Our company pc disabled the taskmanager feature and the only way to kill the task is by using command. thanks for this info.

  28. alberto says:

    Thanks man for the info. I was looking for a way to display the list of processes using psexec (from pstools) when pslist couldn’t connect to the remote pc.

  29. Walter G says:

    Extremely useful post. Best regards.

  30. Flats says:

    This almost got me helped me get rid of a viewing process that school uses to monitor your pc… The only problem is, that when i force kill the process, it will tell me : ‘Access denied’… I hope anyone can tell me how to shutdown administator protected programs…
    Thanks in advance

  31. BBDom says:

    Superb!
    Thank you

  32. Selva says:

    Awesome. I got my task manager itself hanging and i used the follwing command to kill it :)

    taskkill /im taskmgr.exe /f

  33. HK the champion says:

    Thanks yaar, I search it for long time and i got it very easily from your site….
    thanks again…

  34. HK the champion says:

    Thanks a lot
    I want it, but no one can able to answer that
    that got very easily from your site.
    so thanks again.

  35. Alex says:

    is somehow possible to find out location of file on hard drive of process which I know the name?

  36. rebekah says:

    Hi,
    This article is useful. pls help me to pause the window’s process using commands

  37. Navin says:

    @Alex you can look up the name in the registry and it will give you the file location.

    @Rabekah As far as I know I don’t think you can do that

  38. andrrew says:

    very good …………….
    so helpful………
    its impressive

  39. prabhu says:

    you save my life

  40. prabhakar narayanann kutty says:

    great article. thanks. this is exactly what i was looking for the past couple of days.
    keep up the good work

  41. Brutal says:

    This was a big help for me!

  42. Fr0z3n is back! says:

    Yo!!

  43. Karen says:

    Thank you so much! Someone keeps setting up their server inside of my system and it is driving me crazy!
    Will definitely book mark this.

  44. Sunny says:

    It also helped me……………. :)

Leave a Reply

Email Subscription

Disclaimer

The views expressed on this blog are personal. We do not claim to be a representative voice of the views of any organisation whatsoever. We are not responsible for the content present on the blogs to which we have linked.Views expressed are solely that of the author and does not reflect a collective opinion of contributors.