How to pipe STDOUT and STDIN to qbasic program

815 views Asked by At

I would like to know how to properly pipe STDOUT and STDIN to a qbasic program running on DOS 6.22. I would like my qbasic program to be able to run EEUPDATE.exe through the following line "EEUPDATEW.exe /NIC=* /FILE=I211.txt /MAC=* /INVMUPDATE" and then reads in the STDOUT posted by EEUPDATE.exe for further processing. How would I go about doing this? I have been rattling my brain all day and I can't seem to get it to work.

Below if my simple program. Right now it can just grab the MAC address, later on I will increment the MAC address depending on what I receive from STDOUT.

enter image description here

1

There are 1 answers

0
eoredson On

Here is a sample of how to use SHELL in QBasic:

DECLARE SUB GetFiles (Var$)
REM list files in current directory
C$ = "C:*.*"
CALL GetFiles(C$)
END

SUB GetFiles (Var$)
Var2$ = "dir " + Var$ + " > tempfile.dir"
SHELL Var2$
OPEN "tempfile.dir" FOR INPUT SHARED AS #1
DO UNTIL EOF(1)
    LINE INPUT #1, X$
    PRINT X$
LOOP
END SUB