Shell.Execute

number Shell.Execute ( 

string  Filename,

string  Verb = "open",

string  Arguments = "",

string  WorkingFolder = "",

number  WindowMode = SW_SHOWNORMAL,

boolean WaitForReturn = false )

Example 1

MyDocs = Shell.GetFolder(SHF_MYDOCUMENTS);    -- Gets the path to the user's My Documents folder
Shell.Execute(MyDocs .. "\\CompanyInfo.htm", "edit", "", "", SW_SHOWNORMAL);

The first line uses the Shell.GetFolder action to get the path to the user's My Documents folder and stores it in the variable "MyDocs." The file "CompanyInfo.htm" is then opened using the "edit" verb of the Shell.Execute action. This will open the file in the user's associated editor for .htm files.

Example 2

-- Get the session variable and assign it to a regular variable
AppDir = SessionVar.Expand("%AppFolder%");

-- Call a file using the AppDir variable
Shell.Execute(AppDir.."\\Myfile.exe", "open", "", "", SW_SHOWNORMAL);

-- This could also be done as such
Shell.Execute(SessionVar.Expand("%AppFolder%").."\\Myfile.exe", "open", "", "", SW_SHOWNORMAL);

This example shows two ways of using a Shell.Execute action with a session variable.

See also:  Related Actions