I've opened the calculator on windows, Windows 8 to be particular I'm using python 3.7.3 and I wanted to close the calculator application so I wrote the following code

os.system('TASKKILL /F /IM calculator.exe')

What weird thing happened is that it didn't give any error but returned '128' and this returned every time.

os.system('TASKKILL /F /IM notepad.exe')

This worked correctly i.e. while closing the notepad application


I think the executable is calc.exe. I am on windows 10 but I think it should be the same on other versions of windows too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.