mirror of
https://github.com/fofolee/uTools-ProcessKiller.git
synced 2025-12-23 02:33:19 +08:00
增加右键重启进程功能
This commit is contained in:
@@ -51,8 +51,12 @@ tasklist = (callback) => {
|
||||
});
|
||||
}
|
||||
|
||||
taskkill = (taskname, callback) => {
|
||||
let ps = new PowerShell(`chcp 65001;Stop-Process -Name ${taskname}`);
|
||||
taskkill = (taskname, taskpath, callback) => {
|
||||
if (taskpath == undefined) {
|
||||
var ps = new PowerShell(`chcp 65001;Stop-Process -Name ${taskname}`);
|
||||
} else {
|
||||
var ps = new PowerShell(`chcp 65001;Stop-Process -Name ${taskname};Start-Process -FilePath "${taskpath}"`);
|
||||
}
|
||||
ps.on("error-output", data => {
|
||||
callback(data.split('\n')[0])
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user