qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SHELL Statement Details
  QuickSCREEN      Details      Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
SHELL Statement Details
 
Syntax
  SHELL [commandstring]
 
The commandstring must be a valid string expression, containing the name
of a program to run and any program options.
 
Any .COM file, .EXE file, .BAT program, or DOS function that runs under the
SHELL statement is called a "child process." Child processes are executed
by the SHELL statement, loading and running a copy of COMMAND.COM with
the /C option automatically; this option allows any parameters in
commandstring to be passed to the child process. It also allows redirection
of standard input and output, and execution of built-in commands such as
DIR, PATH, and SORT.
 
The program name in commandstring may have any extension you wish. If no
extension is supplied, COMMAND.COM looks for a .COM file, then an .EXE file,
and finally, a .BAT file. If COMMAND.COM is not found, SHELL issues an error
message that reads "File not found." BASIC does not generate an error if
COMMAND.COM cannot find the file specified in commandstring.
 
Any text separated from the program name by at least one blank is treated as
program parameters by COMMAND.COM.
 
BASIC remains in memory while the child process is running. When the child
process finishes, BASIC continues.
 
SHELL with no commandstring gives you a new COMMAND.COM shell. You may
now do anything that COMMAND.COM allows. Enter the DOS command EXIT
when you are ready to return to BASIC.