Page 1 of 1

qBasic or vbDOS shelling and logging question...

Posted: Sat Jun 09, 2012 5:35 pm
by rileyil77
To whom it concerns,

I want to create a program that opens my program, rdmath.exe and then inputs multiple alphanumeric codes in the format xxxx-xxxx-xxxx-xxxx into rdmath.exe.
After it inputs the code it should send the enter command into the program twice. It also needs to log everything it is doing in log file, such as, RDMATH.TXT or RDMATH.LOG.


I have both QBasic and VBDos to compile the program in. My problem is this, I think (it's has been like 12 years since I programmed in QBasic) I run the rdmath.exe program, like this:

SHELL "RDMATH.EXE"

However that's as far as my knowledge goes with shelling. Not sure how to get it take the random alphanumeric code and place it into the program prompt.

Thanks,

Riley

Posted: Sat Jun 09, 2012 11:26 pm
by burger2227
RDMATH.EXE: Compile first.

Code: Select all

cmd$ = COMMAND$

PRINT "[" + cmd$ + "]"
RUNME.EXE: Compile and run second.

Code: Select all

SHELL "RDMATH.EXE 112233"
Place the string data after the EXE file name in the SHELL statement. You should also be able to do that with a BATch file. Numerical string values can be converted back with VAL. Mixed data can be parsed by the called program.

Posted: Sat Jun 09, 2012 11:44 pm
by rileyil77
RDMATH.EXE is already written. It requires a 16 Alphanumeric code in the xxxx-xxxx-xxxx-xxxx be inputed into it. I was wanting to know how to program a file that will repeatedly spit into the RDMATH.EXE the codes and log the codes it spits out also in a text file. Thanks for you help and I will still try this.