Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Reviewed and revised December 2023

tab(-10, AG_WINEXEC); cmdlin; {"~"; workdir;} chr(127);     Tab(-10,x) Syntax Notes

AG_WINEXEC (23) executes a Windows command line on the local Windows workstation or ATE client. Note that unlike most AG_xxx functions, the delimiter here is a tilde ("~") rather than a comma. If workdir is specified, it must be separated from cmdlin with a tilde.

Parameters

cmdlin

A string containing a valid Windows command line. The string may contain any of the suffix characters supported by HOSTEXxs to control how the command line is executed and whether we have to wait for it to complete, as summarized in the following table. Only one suffix option, at max, is allowed, and it must be preceded by a space. See History notes below for macros that can be used in cmdlin.

Suffix

Description

 

(no suffix) The process launched by the cmdlin takes the foreground and A-Shell must wait for it to exit.

&

The process is launched in minimized mode and runs independently of A-Shell (i.e. A-Shell doesn’t wait for it.)

%

The process is launched minimized, but A-Shell still waits for it to complete. This is mainly useful for quick commands where you don’t want to distract the user with its display.

$

The process is launched in the foreground but A-Shell does not wait for it.

 

workdir

establishes the working directory context for the command; if not specified, the current workstation directory is used.

Response

A single byte will be placed in the keyboard buffer to indicate success (ASCII 13, aka RETURN) or failure (ASCII 3, aka Control-C). Note that success just means that the command was successfully executed, not necessarily that the resulting process ran correctly. In the cases where A-Shell is supposed to wait for the command (no suffix or "%" suffix), the byte is not returned until the process exits.

Examples

! launch notepad to view miame.ini on PC and wait

? TAB(-10,AG_WINEXEC);"notepad.exe %MIAMEFILE%";chr(127);

xcall ACCEPN,A

! launch calculator and don't wait

? TAB(-10,AG_WINEXEC);"CALC.EXE $";chr(127);

xcall ACCEPN,A

Notes

Environment variables (known to the PC) may be embedded in the command line using the %VARNAME% syntax, as shown in the first example above.

HOSTEXxs provides nearly the same functionality under A-Shell/Windows, but under A-Shell/Unix executes a Unix command line on the server, whereas AG_WINEXEC always executes a Windows command line on the local workstation.

Also see the following topic, Shell Execute.

u History