0

I have 2 batch files: kill_window1.bat & kill_host.bat. The content of bats are:

  • kill_window1.bat:

    taskkill /f /im some_program.exe
    
  • kill_host.bat

    taskkill /f /im taskhost.exe
    

The problem is that when I execute kill_window1.bat, it's like if I had executed kill_host.bat, and also, the process never ends, because cmd window never ends and still printing the line but nothing happens, just still open and my O.S. crash by more than 20 cmd's.

I'm using Windows 7 in a virtualbox.

Sorry if my English isn't perfect. I'm still learning ;)

PD: I'm killing taskhost.exe because sometimes use 100% CPU.

Michael Becerra
  • 401
  • 1
  • 3
  • 15

1 Answers1

0

Try to use PsKill instead. Btw, it's strange that OS crashes. I hope the "some_program.exe" is not an OS process? Also, it's not a good idea to kill the taskhost.exe. Instead, try to discover which service loads CPU so high and stop only the service instead killing the host that can host several services.

MobileX
  • 409
  • 4
  • 13
  • Hi, thanks for the quick answer. some_program.exe is a C++ program. About taskhost, I tried to see what services are used by it. I opened taskmgr.exe and go to services selecting taskhost.exe but nothing appears on the list. – Michael Becerra Jan 29 '16 at 15:49
  • The "native" taskmgr.exe is not good enough for that. Try [Process Explorer](https://technet.microsoft.com/en-us/sysinternals/processexplorer) instead. – MobileX Jan 29 '16 at 15:54