Macro Toolworks and Perfect Keyboard Forums • Detect if process (Notepad.exe) is running and kill it
Page 1 of 1

Detect if process (Notepad.exe) is running and kill it

Posted: Fri Nov 25, 2016 12:08 pm
by Petr
This macro detects if process (Notepad in this example) is running and kills it on user confirmation.

Code: Select all

<#> Start of the macro
<cmds>

<#> Find notepad.exe in running processech
<if_process>(notepad.exe,EXIST)

   <#> Ask for killing if running
   <msg>(-100,-100,"Notepad.exe is running. Do you want to kill it?","Message",2)

   <#> Is last answer YES?
   <if_str>("_vMsgButton==YES")

      <#> kill process  
      <process_kill>(notepad.exe)

   <endif>

<else>

   <#> No process notepad.exe found, show message
   <msg>(-100,-100,"Notepad.exe is not running.","Message",1)

<endif>

<#> End of the macro