# Function Reference

# ProcessWait

Pauses script execution until a given process exists.

ProcessWait ( "process" [, timeout = 0] )

## Parameters

process | The name of the process to check.
timeout | [optional] Specifies how long to wait (in seconds). Default is to wait indefinitely.

## Return Value

Success: | the Pid of the process.
Failure: | 0 if the wait timed out.

## Remarks

Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"
The process is polled approximately every 250 milliseconds.
This function is the only process function not to accept a PID. Because PIDs are allocated randomly, waiting for a particular PID to exist doesn't make sense.

## Related

ProcessClose, ProcessExists, ProcessList, ProcessWaitClose, RunAsWait, RunWait, WinGetProcess, WinWait, WinWaitActive

## Example

    ; Wait for the Notepad process to exist.

    ProcessWait("notepad.exe")