All pastes #2052243 Raw Edit

Something

public text v1 · immutable
#2052243 ·published 2011-04-30 12:52 UTC
rendered paste body
If the program or document to be run is not integrated with the system, specify its full path to get it to launch:

Run %A_ProgramFiles%\Winamp\Winamp.exe

In the above example, %A_ProgramFiles% is a built-in variable. By using it rather than something like C:\Program Files, the script is made more portable, meaning that it would be more likely to run on other computers. Note: The names of commands and variables are not case sensitive. For example, "Run" is the same as "run", and "A_ProgramFiles" is the same as "a_programfiles".

To have the script wait for the program or document to close before continuing, use RunWait instead of Run. In the following example, the MsgBox command will not execute until after the user closes Notepad:

RunWait Notepad
MsgBox The user has finished (Notepad has been closed).

To learn more about launching programs -- such as passing parameters, specifying the working directory, and discovering a program's exit code -- click here.