如何在【命令提示字元】強制關閉程式 [bat 關閉程式]
如何在【命令提示字元】強制關閉程式 [bat 關閉程式]
資料來源: https://dotblogs.com.tw/chou/2012/01/14/65787
1. 開啟【命令提示字元】,輸入 tasklist 按 Enter 鍵,可取得目前正在執行中的處理程序清單。
2. 找出您要關閉的程序,輸入指令 taskkill /f /im 程式名稱,其中 /f 參數可強制終止處理程序。例如我要關閉 notepad.exe,則輸入 taskkill /f /im notepad.exe 按 Enter 鍵。
EX:[啟動WEBSERVER+執行PHP->最後關閉所有程式]
start usbwebserver.exe wget.exe "http://localhost:8080/php_curl_https.php" taskkill /f /im usbwebserver.exe
One thought on “如何在【命令提示字元】強制關閉程式 [bat 關閉程式]”
CMD/BAT tasklist kill process by name [ 關閉/砍/停止 目前執行 程式/軟體]
To kill a process by name in Windows using the tasklist and taskkill commands, follow these steps:
Open a command prompt by pressing the Windows key + R and typing cmd in the Run dialog box.
Type tasklist /fi “imagename eq processname.exe” and press Enter. Replace processname.exe with the name of the process you want to kill.
Note down the Process ID (PID) of the process from the output of the above command.
Type taskkill /f /pid pid_number and press Enter. Replace pid_number with the PID of the process you want to kill.
For example, if you want to kill the Google Chrome process, you would type:
bash
Copy code
tasklist /fi “imagename eq chrome.exe”
Note down the PID of the process from the output, and then type:
bash
Copy code
taskkill /f /pid pid_number
Replace pid_number with the PID you noted down.