The ability to perform tasks from a system’s command line allows those tasks to be used in batch files. This recipe describes several uses of taskkill to terminate Windows processes.
If you know the name of a process to kill, for example notepad.exe, use the following command from a command prompt to end it:
taskkill /IM notepad.exe
To kill a single instance of a process, specify its process id (PID). For example, if the desired process has a PID of 827, use the following command to kill it:
taskkill /PID 827