Pass Command to Command Interpreter for Execution





QuickBasic


' DOS 2+ - PASS COMMAND TO COMMAND INTERPRETER FOR EXECUTION

'$INCLUDE: 'qb.bi'

DIM CommandLine AS STRING
DIM inregs  AS RegTypeX
DIM outregs AS RegTypeX

CommandLine = CHR$(7) + "gwbasic" + CHR$(13)  ' commandline to execute
inregs.DS = VARSEG(CommandLine)
inregs.SI = SADD(CommandLine)

' Does not work
CALL InterruptX(&H2E, inregs, outregs)

IF outregs.AX > 0 THEN
   PRINT "Error executing command"
   BEEP: END
END IF