按文件名杀死进程 [英] Kill process by filename
本文介绍了按文件名杀死进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有 3 个从不同地方运行的应用程序实例.所有进程都有相似的名称.
I have 3 instances of application running from different places. All processes have similar names.
如何终止从特定位置启动的进程?
How can I kill process that was launched from specific place?
推荐答案
可以获取应用路径:
Get-Process | Where-Object {$_.Path -like "*something*"} | Stop-Process -WhatIf
这仅适用于本地机器.终止远程进程:
That will work for the local machine only. To terminate remote processes:
Get-WmiObject Win32_Process -Filter "ExecutablePath LIKE '%something%'" -ComputerName server1 | Invoke-WmiMethod -Name Terminate
这篇关于按文件名杀死进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文