# exec

Runs an application.

    exec <command line> [<show> [<wait> [<current directory>]]]

## Remarks

Runs an application specified by <command line>.

    here show command:
    hide
    minimize
    maximize
    show ;default parameters when no show command specified.

When a user specifies the 1 at the <wait> argument, Tera Term waits to finish the launched application. The exit code of the application stores the `result' system variable. (version 4.63 or later)

A current directory can be specified at the <current directory> argument. (version 4.78 or later)

## Example

    ; Run "Notepad".
    exec 'notepad readme.txt'

    ; Run "Notepad" and maximize the application.
    exec 'notepad readme.txt' 'maximize'

    ; Run "Notepad" with the current directory.
    exec 'notepad readme.txt' 'show' 0 'c:\usr'

    ; Launch a batch file.
    tmp='cmd /c c:\upload.bat '
    strconcat tmp username1
    strconcat tmp ' '
    strconcat tmp userpass1
    strconcat tmp ' '
    strconcat tmp address
    messagebox tmp 'exec'
    exec tmp

    ; Make a directory.
    getenv "USERPROFILE" userprof
    getdate logdir "log-%Y%m%d"
    sprintf2 cmd 'cmd /c mkdir "%s\My Documents\%s"' userprof logdir
    exec cmd "HIDE"