c# kill process (C# 刪/砍 正在執行的 EXE 程序/程式) (Kill some processes by .exe file name)
c# kill process (C# 刪/砍 正在執行的 EXE 程序/程式) (Kill some processes by .exe file name)
資料來源: https://stackoverflow.com/questions/3345363/kill-some-processes-by-exe-file-name
實測應用場合: MYSQL用BAT啟動(為了多MYSQL同時執行),結束主程式要將MYSQL關閉
foreach (var process in Process.GetProcessesByName("mysqld_v8")) { process.Kill(); }
PS 多MYSQL同時執行BAT
REM 指定mysqld和對應參數檔的完整路徑位置 "C:\Users\jashliao\Desktop\192_168_1_68 API\20191004\SYWEB-V8-Workstation(Delta)\SYWEB-V8-Workstation\bin\Debug\mysql\bin\mysqld_v8.exe" --defaults-file="C:\Users\jashliao\Desktop\192_168_1_68 API\20191004\SYWEB-V8-Workstation(Delta)\SYWEB-V8-Workstation\bin\Debug\mysql\my.ini"
One thought on “c# kill process (C# 刪/砍 正在執行的 EXE 程序/程式) (Kill some processes by .exe file name)”
C# PROCESS 尋找/搜尋 正在執行 EXE/程式/軟體