Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
Tripredacus

Prompt for variable in DOS 7.1

Recommended Posts

Working on a little project to prompt for input before using it in a command.

set /p input= Enter the system Serial Number.rem temp.exe /ss %input%md %input%

This does not work as Set in DOS 7.1 does not recognize the /p option. Instead it will add an environment variable that says:

/p input= Enter the system Serial Number.

Is there another method to get a prompt for input in this version? I had difficulty researching this on google. This is a booted DOS 7.1 and not running in a cmd.exe in Windows.

 

Note in my batch example, I don't want to execute the application during testing, but do want to see what the variable is, which is why it is remaked, and also making a test dir with the variable just to make sure it functionally works.

Share this post


Link to post
Share on other sites

There's a Freeware program floating around somewhere that "simulates" that AFAICR.

It *may* have been used in one of soporific's projects. When I get a chance I'll look around to see if I'm missing the boat.

 

Meanwhile, pretty sure jaclaz will notice and find it or something similar.

  • Upvote 1

Share this post


Link to post
Share on other sites

There is not a "built-in" prevision in COMMAND.COM  (it was introduced in CMD:EXE).

You can use a third party tool or a "workaround" making use of choice in a loop or using a temp file and redirection (nasty) or using a CALL (to "self"), see:

http://www.infionline.net/~wtnewton/batch/batguide.html#4

There is also a trick using ANSI conversion:

http://www.robvanderwoude.com/userinput.php#DOS

the latter link above contains links to commonly used third party tools,personally I would use editvar:

http://www.westmesatech.com/editv.html

 

jaclaz

  • Upvote 1

Share this post


Link to post
Share on other sites

A little more advanced BASIC was to use QBasic.

 

Example test.bat could use:

C:\DOS71\QBASIC /run test.bas

and test.bas in which QBasic interprets could use:

REM Get the users input.INPUT "Enter the system Serial Number"; reply$REM Show the value of the reply.PRINT reply$REM Return to the system.SYSTEM

Some examples shown in this PDF on page 14 for retrieving input from the user in QBasic. If you wanted the bas file compiled then the MS-DOS compatible version of FreeBasic could be used.

 

Share this post


Link to post
Share on other sites

A little more advanced BASIC was to use QBasic ...

... right when I was reasonably convinced that our friend Gunsmokingman would have not been able to post a VBS script ....  :whistle: 

 

You can never be sure of anything....;)

 

:D

 

jaclaz

Share this post


Link to post
Share on other sites

jaclaz,

 

QBasic is a part of MS-DOS 7.1 and offers a prompt. So, a nice try. Besides, VBScript did not exist in the era of MS-DOS AFAIK. Not much did exist for Microsoft at that time. Hard times then and I do not miss it. The more a programming language can do, the more flexible I find in using it. MS-DOS was/is differcult because of its limitations.

 

Edit: Hmm, typing Microsoft adds a link to the Microsoft store. Such irony.

Edited by MHz

Share this post


Link to post
Share on other sites

I think my older version of this bootable DOS had QBasic in it... Anyways the Editvar does the trick just fine. It shows me the command in the rem and creates the dir using the variable name.

editvar -p "Enter the system Serial Number." INPUTrem temp.exe /ss %INPUT%md %INPUT%
I wasn't sure if the variable name was case sensitive, but I didn't want to test that out. :P

Share this post


Link to post
Share on other sites

jaclaz,

 

QBasic is a part of MS-DOS 7.1 and offers a prompt. So, a nice try. Besides, VBScript did not exist in the era of MS-DOS AFAIK. Not much did exist for Microsoft at that time. Hard times then and I do not miss it. The more a programming language can do, the more flexible I find in using it. MS-DOS was/is differcult because of its limitations.

Sure :), I was referring to the "usual plot" :

http://www.msfn.org/board/topic/173609-btach-set-vast-with-echo-doesnt-work/#entry1096004

just kidding....

 

jaclaz

Share this post


Link to post
Share on other sites

 

jaclaz,

 

QBasic is a part of MS-DOS 7.1 and offers a prompt. So, a nice try. Besides, VBScript did not exist in the era of MS-DOS AFAIK. Not much did exist for Microsoft at that time. Hard times then and I do not miss it. The more a programming language can do, the more flexible I find in using it. MS-DOS was/is differcult because of its limitations.

Sure :), I was referring to the "usual plot" :

http://www.msfn.org/board/topic/173609-btach-set-vast-with-echo-doesnt-work/#entry1096004

just kidding....

 

jaclaz

 

I accept it as an insult else why the link? MS-DOS is a complete OS and QBasic is a part of it as I already mentioned. The comparison to batch is rather dry for my taste. Nice try again.

Share this post


Link to post
Share on other sites

 

I accept it as an insult else why the link? MS-DOS is a complete OS and QBasic is a part of it as I already mentioned. The comparison to batch is rather dry for my taste. Nice try again.

 

As said I was just kidding, without any intention to offend, nor to insult anyone or anything.

 

I'm really really sorry, I apologise unreservedly. I take it back and offer a complete and utter retraction. The imputation was totally without basis in fact, and was in no way fair comment, and was motivated purely by malice, and I deeply regret any distress that my comments may have caused you, or your family, and I hereby undertake not to repeat any such slander at any time in the future.

 

Is this OK with you?

 

However, to be picky and just for the record, MS-DOS 7.1 (though it includes Qbasic alright) is not a complete OS, it is part of some Windows operating systems, (namely Windows 95 OSR 2, Windows 95 OSR 2.5, Windows 98, and Windows 98 SE).

 

jaclaz

Share this post


Link to post
Share on other sites

As said I was just kidding, without any intention to offend, nor to insult anyone or anything.

I'm really really sorry, I apologise unreservedly. I take it back and offer a complete and utter retraction. The imputation was totally without basis in fact, and was in no way fair comment, and was motivated purely by malice, and I deeply regret any distress that my comments may have caused you, or your family, and I hereby undertake not to repeat any such slander at any time in the future.

 

Is this OK with you?

Your 1st line seems original. A person, like yourself, saying something and then using a contradiction will always be quite disturbing. This seems like a recurring pattern for you. Using a method of insult and then using a just kidding, but ..., however ..., and any other alternation does not hide the insult.

 

To use a copy and paste of a movie quote used by Archie from the movie "The Fish called Wanda" is quite disingenious. So is the copy and pasted quote OK with me? I am not sure how to score such a non genuine statement from you. Silliness with the movie quote does not pass as sincere regret to me. I guess the joke is on me.

 

However, to be picky and just for the record, MS-DOS 7.1 (though it includes Qbasic alright) is not a complete OS, it is part of some Windows operating systems, (namely Windows 95 OSR 2, Windows 95 OSR 2.5, Windows 98, and Windows 98 SE).

MS-DOS exists in the Win 9x OSes as mentioned here. It details of how to boot into MS-DOS. So, it existed in Win 9x in one form or another and most possibly complies as an OS. So, as MS-DOS in 9x as being not a complete OS in its own right is very much in doubt considering an OS can be almost any operating environment.

Share this post


Link to post
Share on other sites

I really cannot see how and where I have insulted you. :unsure:

 

Should I have done so or should you perceive anything I wrote on this thread as an insult to you :(, I wish to assure you that it was unintentional and I apologize for it.

 

My intention was to jokingly remark about the "tradition" where on *any* question BATCH related on MSFN usually Gunsmokingman provides a (usually very good) Visual Basic Script alternative, and how in this case where it was not possible because the DOS (7.1 or otherwise) does not have VBS, you (nicely) provided a Quick Basic (valid) alternative, effectively taking  the role that  Gunsmokingman has in the "tradition".

 

jaclaz

Share this post


Link to post
Share on other sites

However, to be picky and just for the record, MS-DOS 7.1 (though it includes Qbasic alright) is not a complete OS, it is part of some Windows operating systems, (namely Windows 95 OSR 2, Windows 95 OSR 2.5, Windows 98, and Windows 98 SE).

Is there a difference between DOS 7.1 and a DOS 7.10? This bootable DOS is made from boot files from a DOS 7.10 (specifically) installation.

Share this post


Link to post
Share on other sites
Is there a difference between DOS 7.1 and a DOS 7.10? This bootable DOS is made from boot files from a DOS 7.10 (specifically) installation.

 

7.1 is 7.10 as much as 7.0 is 7.00, both do not "exist" the 7.00 (or 7.0 is the same) is the DOS underlying the first release of Windows 95 or Windows 95 A, the 7.1 (or 7.10 is the same) is the DOS underlying the later windows 95 and 98 releases.

Wiindows ME has underlying a DOS 8.0 (or 8.00 is the same).

 

No version of DOS past 6.22 were ever releases by MS as a "self standing" OS:

https://en.wikipedia.org/?title=MS-DOS

try running VER at the command prompt:

https://en.wikipedia.org/wiki/Ver_(command)

http://www.robvanderwoude.com/ver.php

 

You could not at the time buy a box like this one:

http://www.ebay.com/itm/Microsoft-MS-DOS-6-22-Upgrade-PC-1994-Factory-Sealed-/400936061362?pt=LH_DefaultDomain_0&hash=item5d59a6c9b2

but with DOS 7.0 or 7.1 in/on it.

 

jaclaz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...