File.Run

number File.Run ( 

string  Filename,

string  Args = "",

string  WorkingFolder = "",

number  WindowMode = SW_SHOWNORMAL,

boolean WaitForReturn = false )

Description

Runs an executable.

Note: If you are distributing on Windows Vista or later and have used a requested execution level other than "Require administrator," you should use the Shell.Execute action instead.

Parameters

Filename

(string) The path to the executable (.exe) file.

Args

(string) The command line arguments to pass to the executable.

WorkingFolder

(string) The working folder to set for the executable file.

Note: This sets the current directory for the operation to something other than the folder that the file is in. Normally, you can just leave it blank.

WindowMode

(number) The window mode to use:

CONSTANT

VALUE

DESCRIPTION

SW_SHOWNORMAL

1

Normal. (Default)

SW_MAXIMIZE

3

Maximized.

SW_MINIMIZE

6

Minimized.

SW_HIDE

0

Hide.

WaitForReturn

(boolean) Whether the application will wait until the executable has exited before continuing:

VALUE

DESCRIPTION

true

Wait.

false

Don't wait. (Default)

Returns

(number)  The process return code if the WaitForReturn parameter is set to true. If WaitForReturn is set to false 0 is returned. You can use Application.GetLastError to determine whether this action failed, and why.

Note: On Windows Vista or later, if this action fails due to requiring elevation, error code 1045 is returned.

Note: If the specified process has not terminated, the termination status returned is STILL_ACTIVE. If the process has terminated, the termination status returned may be one of the following:

The exit value specified in the ExitProcess or TerminateProcess function.
The return value from the main or WinMain function of the process.
The exception value for an unhandled exception that caused the process to terminate.

See also:  Related Actions