How to get the total number of processes with the same name?
I try to use
Process, Exist, PIDOrName
, but it can only return the PID of one process, is there any other way?
How to get the total number of processes with the same name? Topic is solved
Re: How to get the total number of processes with the same name? Topic is solved
Some like this ?
Code: Select all
Gui, Add, listview , w1000 h300,Name|Cmdline|Pid
for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process where CommandLine like '%autohotkey%'")
{
pNam := process.Name
pCom := process.CommandLine
pPid := process.ProcessId
lv_add("", pNam, pCom, pPid)
}
LV_ModifyCol(1,150)
LV_ModifyCol(2,650)
LV_ModifyCol(3,"100 Integer")
Gui, Show
return
GuiEscape:
GuiClose:
*Esc::
ExitApp
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Re: How to get the total number of processes with the same name?
Hallo,
try:
try:
Code: Select all
No := 0, ProzessName := "Firefox.exe"
for Prozess in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
No += Prozess.Name = ProzessName
MsgBox,% No " " ProzessName