qBasic or vbDOS shelling and logging question...

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
rileyil77
Newbie
Posts: 8
Joined: Sat Jun 09, 2012 5:26 pm
Location: Pontotoc, MS
Contact:

qBasic or vbDOS shelling and logging question...

Post 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
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post 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.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
rileyil77
Newbie
Posts: 8
Joined: Sat Jun 09, 2012 5:26 pm
Location: Pontotoc, MS
Contact:

Post 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.
Post Reply