There may be times when you want to close a process from the command line on a Windows machine. The ‘taskkill’ command allows you to kill processes/programs by process id or exe name (image name).
You can do the same thing from the windows task manager, but sometimes this is not suitable. For example, if you have a number of Internet Explorer windows open, they will each run under their own process. If using the task manager, you have to kill each process separately. With taskkill you can specify to kill the exe/image name ‘iexplore.exe’ and it will terminate all instances of that process.
Example taskkill command:
taskkill /f /im iexplore.exe