Hi Reloaded,
The #IfWin directives are positional: they affect all hotkeys and hotstrings physically beneath them in the script. They are also mutually exclusive; that is, only the most recent one will be in effect.
source:
#IfWinActive/Exist
Use
Process, Exist instead - for example:
Code: Select all
for index, program in ["chrome.exe", "notepad.exe"]
{
Process, Exist, % program
if not (ErrorLevel) ; ErrorLevel to the Process ID - evaluated as true here - if a matching process exists, or 0 - false - otherwise.
return ; at least one of the program does not exist
}
; otherwise...
MsgBox,
run command wrote:
Parameters
Target
A document, URL, executable file (.exe, .com, .bat, etc.), shortcut (.lnk)
In your source your program lacks its
extension. Besides, if your program is not in one of the PATH folders or in the script's working directory, the full path must be specified:
Code: Select all
Run, Cleaner.exe ; supposed to be in the script own directory
run, notepad ; one of the "integrated" program, in the system32