Cannot end processes with taskkill, get "the system cannot find the file specified" error

1

0

Whenever I run the following in a command prompt:

taskkill /f /im chrome.exe

I get an error saying "the system cannot find the file specified".

I've tried that command without the /f option, and with other processes, but get the same result. I've researched the error message but haven't found anything useful.

How can I fix this? Alternatively, is there another way to kill processes from the command prompt?

I'm running Windows 7 Home Basic 32-bit, only doesn't work on netbook.

Tasklist gives the same error, and I've read somewhere that tasklist is not avilable in the Home Basic edition, so can the same be true for taskkill as well? Although I can see that both taskkill and tasklist executables exist in the system32 folder.

user196791

Posted 2013-02-08T20:16:49.573

Reputation: 33

I solved this by adding C:\Windows\system32; at the start of PATH in environment variables – JinSnow – 2017-02-25T20:46:51.187

2

Did you run sfc /scannow (see http://support.microsoft.com/kb/929833 )

– sgmoore – 2013-02-08T20:47:43.690

Answers

1

Not sure about Win7 Home Basic, but if taskkill.exe and tasklist.exe don't exist in Windows\System32, just use PsKill instead (also available as part of the PsTools Suite).

Karan

Posted 2013-02-08T20:16:49.573

Reputation: 51 857

i ll try pskill now, but those files do exist... ok pskill worked, thank you very much ! – user196791 – 2013-02-08T21:09:38.990

1

If they do exist, then check the PATH environment variable and confirm that Windows\System32 is the very first directory specified.

– Karan – 2013-02-08T22:12:54.523

2

I am guessing that your PATH environment variable is not set correctly. Run echo %PATH% in Command Prompt, and if the output does not include C:\Windows\system32, then that is your problem.

To fix:

  • Go to Start Menu
  • Right click Computer
  • Click Properties
  • Click Advanced System Settings
  • In the Advanced tab, click Environment Variables
  • Under System Variables, find PATH
  • Click Edit
  • Put C:\Windows\system32; at the start of PATH
  • Click OK and Apply until you are out of everything
  • You may need to reboot your computer for the changes to take effect

Hope this helps!

BenjiWiebe

Posted 2013-02-08T20:16:49.573

Reputation: 7 672

0

Taskkill is not available in Windows XP/7 Home edition.

Instead you can use tskill which is available in all Windows editions.

seizu

Posted 2013-02-08T20:16:49.573

Reputation: 131

0

I believe that the windows standard task manager can easily do what you ask.

mdpc

Posted 2013-02-08T20:16:49.573

Reputation: 4 176

i know, but i need to do it from cmd – user196791 – 2013-02-08T20:32:56.803

2In the future please include all revelent information in your question so that you get an answer appropriate to your situation. – mdpc – 2013-02-08T20:34:17.133