I write a batch script to kill process, here is it
@echo off
IF "%1" NEQ "" (
Set "process=%1.exe"
echo "killing process %process%"
taskkill /F /IM %process% /T
)
I name it to mkill.cmd
.
C:\Users\Administrator>mkill chrome
"killing process "
ERROR: Invalid syntax.
Type "TASKKILL /?" for usage.
C:\Users\Administrator>mkill chrome
"killing process chrome.exe"
SUCCESS: The process with PID 8892 (child process of PID 7732 ) has been terminated.
SUCCESS: The process with PID 4024 (child process of PID 7732 ) has been terminated.
C:\Users\Administrator>mkill telegram
"killing process chrome.exe"
Error: The process "chrome.exe" not found.
C:\Users\Administrator>mkill test
"killing process telegram.exe"
SUCCESS: The process with PID 2896 (child process of PID 3952 ) has been terminated.
It seems it has a delay in parameter pass. What's the problem?