Please enable JavaScript to view this site.

A-Shell Consolidated Reference

AGCMD {switches} <cmd> <parms>

AGCMD is used to send an AG_xxx function from the system prompt or from within a command file, thereby avoiding the need to write and compile a program. It is useful for experimentation and for inserting simple ATE or other GUI configuration functions in startup command files.

Switches

Switch

Function

/K#

Assign result to DO file variable $KBD#

/S

Silent (don't display the command response)

/N

No wait (don't wait for any response)

/W:#

Wait # seconds for response (overriding default)

/?

Writes switch listing and usage info to the screen.

Parameters

cmd

the symbolic AG_xxx name—case insensitive, with or without the AG_ prefix—or numeric value of the AG command to execute.

parms

the parameter list as it would be passed in the AG_xxx statement, except without the trailing chr(127).

Examples

AGCMD WINEXEC,$DEL %ATE%\dsk0\001004\ftpdlx.log

AGCMD WINTITLE,This is the new and improved title

AGCMD SHOWWINDOW 3

AGCMD STATUSLINES,1,0

AGCMD/S 24,cmd.exe,option,"/c ipconfig > ipcfg.lst",,0,1

AGCMD/N PALETTE,3,0,123,207,242

AGCMD/S/K1 BROWSEFOLDER

.AGCMD GETENV %TEMP%

Response = C:\Users\joaqu\AppData\Local\Temp

 

Comments

If neither of the /N or /W:# switches are specified, AGCMD will use the "normal" wait value based on the function itself, ranging from no wait (for functions with no response, e.g. AG_STATUSLINES), to a few seconds (for functions with an immediate response, e.g. AG_GETENV), to unlimited (for functions which require a user response, e.g. AG_WINPTR).

Some functions have a variable response (or lack of), depending on the function parameters. For example, AG_PALETTE has no response when used to set a color, but has a "standard wait time" response when used to retrieve palette info. For these functions, AGCMD defaults to the "standard wait time" of a few seconds. To avoid waiting for a response that won't be coming, use the /N switch as in the example above.

History

2023 August, A-Shell 6.5.1740, AGCMD.LIT 1.0(108):  Enhanced to support AG_FILETIMES, AG_GETDPI, AG_DPM, AG_DIRCLEAN.

2017 July, A-Shell 6.5.1610, AGCMD.LIT 1.0(105):  Enhanced to support AG_SCROLLBACK:

.AGCMD AG_SCROLLBACK -1         ; toggle 

.AGCMD AG_SCROLLBACK 1          ; show/enable

.AGCMD AG_SCROLLBACK 0          ; hide/disable

 

2011 May, A-Shell 5.1.1215:  Added function to A-Shell