The IsRunning function checks if the specified process is running.
Used to check if a process is running and take conditional action depending on the result.
var = IsRunning(<process_name>)
<process_name>. string, name of the process to check (case insensitive). If <process_name> does not include an extension, the .EXE extension is assumed. <process_name> can include a path.
var, integer. If <process_name> is running, the return value is 1. If it is not running or if the function fails, the return value is 0.
a = IsRunning("Wordpad") ' Returns 1 if Wordpad.exe is loaded.
a = IsRunning("Comdlg32.dll") ' Returns 1 if Comdlg32.dll is loaded.
prog$ = "c:\WinTask\mfc42.dll"
a = IsRunning(prog$) ' Retunrs 1 if mfc42.dll is loaded (the one in c:\WinTask)
'Kills the application if it is running
If IsRunning("notepad") then