I want to get the process ID of a running program (as possible to find in the task manager).
I have tested
Code: Select all
Process Exist, Label32.exe
PID := ErrorLevel
MsgBox 64, Row %A_LineNumber% -> %A_ScriptName%, PID = %PID%
//Jan
Code: Select all
Process Exist, Label32.exe
PID := ErrorLevel
MsgBox 64, Row %A_LineNumber% -> %A_ScriptName%, PID = %PID%
Code: Select all
SetTitleMatchMode 2
Run c:\windows\system32\schtasks.exe /run /tn Skyltprogram,, MAX, LabelPID ; Run Label32.exe from the scheduled task right now
Sleep 3000
Process Exist, Label32.exe ; In the task manager stands "Label32.exe *32" (win7 without "")
PID := ErrorLevel
MsgBox 64, Row %A_LineNumber% -> %A_ScriptName%, PID = %PID% `nLabelPID = %LabelPID%
Code: Select all
Sleep 3000
Code: Select all
WinWait ahk_pid Label32.exe
Code: Select all
RunWait c:\windows\system32\schtasks.exe /run /tn Skyltprogram,, MAX