2.21 如何CLI获取指定进程的CommandLine
https://scz.617.cn/windows/202211071316.txt
A:
Opera开起来后台有十几个同名进程,Process Explorer可以查看CommandLine,据说 太长时也显示不全,wmic可获取最完整的CommandLine。
wmic process where name="opera.exe" get CommandLine,Name,ProcessId wmic path win32_process where name="opera.exe" get CommandLine,Name,ProcessId
找出与页面浏览实际相关的那个进程
wmic process where name="opera.exe" get CommandLine,Name,ProcessId | findstr network.mojom.NetworkService wmic path win32_process where name="opera.exe" get CommandLine,Name,ProcessId | findstr network.mojom.NetworkService
如下命令可知还有哪些字段可用,大小写不敏感
wmic process where name="opera.exe" get /format:list | more wmic path win32_process where name="opera.exe" get /format:list | more