Shell.Execute

number Shell.Execute ( 

string  Filename,

string  Verb = "open",

string  Arguments = "",

string  WorkingFolder = "",

number  WindowMode = SW_SHOWNORMAL,

boolean WaitForReturn = false )

Description

Performs a shell execute on a target with a given shell verb.

Parameters

Filename

(string) The file or folder path to use.

Verb

(string) The verb to use in the shell command. Choose from:

VERB

DESCRIPTION

open

Opens the file. This is the same as if you double clicked on the file in Windows.

explore

Opens the file/folder in Windows Explorer.

edit

Opens the file for editing using the associated editor.

print

Uses the associated viewer to print the file.

Note: If you set this verb to an empty string (""):
- For Windows XP and later systems, the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry.

Arguments

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

WorkingFolder

(string) The working directory that will be used for the 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. Choose from:

CONSTANT

VALUE

DESCRIPTION

SW_SHOWNORMAL

1

The file will launch normally.

SW_MAXIMIZE

3

The file will launch maximized.

SW_MINIMIZE

6

The file will launch minimized.

SW_HIDE

0

The file will launch hidden.

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: 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