AppExist

Tells if an application is running.

Syntax:

AppExist (program-name [, flags [, retries]])

Parameters:

(s) program-name:  name of a Windows EXE or DLL file.

(i) flags: [optional] a bitmask of values that may be combined using the bitwise OR ('|') operator. The following values may be specified:

Value

Meaning

1

current-session-only.
 

2

"program-name" specifies a process ID instead of a program name
 

(i) retries number of retries. Default is 7 retries (with a half-second delay between tries) before returning, if the specified application doesn't exist.  You can override this by specifying different value for "retries", which may be >= 0 (0 = no retries).

Returns:

(i)  @TRUE if the specified application is running; @FALSE if the specified application is not running.

 

Use this function to determine whether a specific Windows application is currently running. Unlike WinExist, you can use AppExist without knowing the title of the application's window.

"Program-name" is the name of a Windows EXE or DLL file, including the file extension (and, optionally, a full path to the file).

This function accepts module names instead of full program names. The module name is usually the same as the root name of the program, without the extension.

With AppExist and AppWaitClose, any file extension or path information which is part of the 'program-name' parameter is ignored; so, for example

 

AppExist("c:\temp\notepad.exe")

 

will return TRUE, if Notepad is running, regardless of what directory NOTEPAD.EXE is actually located in.

Note: AppExist and AppWaitClose are not able to detect the existence of 16-bit DOS or Windows applications. Vista/2008 and newer: This function may require an Administrator level account, because it relies on performance monitoring.

Example:

If AppExist("notepad.exe")==@FALSE Then Run("notepad.exe", "")

See Also:

AppWaitClose, TerminateApp,RunWait, RunShell, WinClose, WinExeName, WinExist