Shell Command

Purpose

Invokes the command interpreter

Syntax

Shell t

x% = Shell(t)

t:sexp
x%iexp, return value

Description

Shell runs the command interpreter and so enables execution of DOS commands from within a GFA-BASIC 32 program.

Example

Shell "CHKDSK a: /f"      //tests the disk in drive A:

Shell "command.com"     // invokes Command.Com (Windows 9.x)

Shell "cmd"             // calls cmd NT, 2000, XP

Dim x% = Shell("Dir /4 | More")

Debug.Show

Debug.Print "Return value of Shell = ";x%

Remarks

With Open "CONOUT$" For Output As and AllocConsole() a command console can be opened and gives the application access to the input and output in the console. See Open.

See Also

Exec, ShellExec, System, WinExec

{Created by Sjouke Hamstra; Last updated: 23/10/2014 by James Gaite}