TIP: Click on subject to list as thread! ANSI
echo: batpower
to: ALL
from: Denis.Boyles@f290.n153.z1.fidonet.org (Denis Boyles)
date: 1997-03-10 00:00:00
subject: Variables

Hello,

JE>    I don't have any batch enhanceres so what I am looking for is a pure
JE>    DOS sulotion (I am running 7.0).

JE>    Questions:
JE>    1) Can I make a batch file ask for a variable to be filled in at a
JE>    certain point?

Not that I know. You could probably do something with the CHOICE command and
build up a file string.

JE>    I.E. Ask the user what file they want to print and allow them to type

Perhaps you could use QBASIC that comes with DOS 5.0+ as a sort of front end.

For example: (MS-DOS v6.2 QBASIC v1.1)

    INPUT "File to print"; file$
    SHELL "TYPE " + file$ + "| MORE"

When RUN, would ask for a filename specification and store it in the variable
FILE$. Then QBASIC is shelled to DOS and calls the program with filename and
parameters that follow the SHELL command.

An expanded run through might look like this:

    File to print ? C:\CONFIG.SYS
    SHELL "TYPE C:\CONFIG.SYS | MORE"

To use this within a BATCH file, add a SYSTEM line and then save to a file.
Then in your BATCH file, just use QBASIC /RUN filename which will load and
run the BASIC program. The SYSTEM command will exit QBASIC when the program
is finished.

If you're using WIN '95's DOS and you can't find QBASIC it might be on your
disks or on the CD-ROM. If you're using a different DOS, they might have
a similar BASIC or enhanced batch command set.

PS: There's one drawback of using QBASIC. Because it shells to DOS QBASIC
    will leave 100K or so in memory.

Cheers,
  Denis Boyles


 * OLX 2.1 TD * --T-A+G-L-I+N-E--+M-E-A+S-U-R+I-N-G+--G-A+U-G-E--

SOURCE: alt.fidonet via archive.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.