? tab(-10, AG_WINEXEC); cmdlin; chr(127);
xcall ACCEPN, a
? tab(-10, AG_WINEXEC); cmdlin; "~"; workdir; chr(127);
xcall ACCEPN, a
Note: see History below for special variations of the syntax.
AG_WINEXEC (23) executes a Windows command line on the local Windows workstation or ATE client. The first syntax shown above assumes the current A-Shell or ATE working directory; the second allows you to specify a different directory.
Parameters
cmdlin
A string containing a valid Windows command line. The string may contain any of the suffix characters supported by HOSTEX.SBR to control how the command line is executed and whether we have to wait for it to complete, as summarized in this table. (Note: only one suffix option, at max, is allowed, and it must be preceded by a space.):
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. |
Return value
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.
HOSTEX.SBR 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