VOGONS


First post, by Thrash75

User metadata
Rank Newbie
Rank
Newbie

Hello good people,

New user here. 😀 Just built myself a nice DOS rig (PentiumMMX-233, S3 Trio64V+, AWE-32, 64mb).

I run a pure MS-DOS 6.22 environment. I am using .bat files to launch my games (audio volume, mouse sensitivity, etc.). A new game I added runs too fast, and I have to slow the machine down, before I run it. That's fine, I know how to do that. I made a batch file, where the user can select between full speed (no slowdown) or 13% speed, which the game runs fine with. This works great. But I thought of going one step further.. I'd like to be able to set the speed at which it runs. This requires input from the user. A number (1-100) which should be store as a variable (like %speed% fx.), and then used when starting the slowdown process.

But I can't figure out how to get simple user input in a batch file. It baffles me. The "set /p" does not work. How is this done?

-Brian

Brian

Reply 1 of 8, by blurks

User metadata
Rank Oldbie
Rank
Oldbie

You could make yourself familiar with arguments. This way you can call a batch file with the desired speed as an argument. You could also work just with variables within the batch file, i.e. ask the user which speed should be set and store the answer as a value which is then being integrated into the call of the games executable. Numerous ways possible.

> https://stackoverflow.com/questions/26551/how … to-a-batch-file
> https://www.sevenforums.com/tutorials/78083-b … e-commands.html

Thrash75 wrote:

But I can't figure out how to get simple user input in a batch file. It baffles me. The "set /p" does not work. How is this done?

That is usually how it works. Surprised it won't work with you. Slightly altered sample code from the link above:

SET /P M=Type 1 or 2 then press ENTER:
IF %M%==1 GOTO OPTION1
IF %M%==2 GOTO OPTION2

Reply 2 of 8, by Big Pink

User metadata
Rank Member
Rank
Member

Keep in mind a lot of the functionality of batch scripts came about after DOS and 9x died. Wikipedia reports 'SET /P' was introduced in Windows 2000. I think 'CHOICE /C' with multiple options is available in 6.22 (https://en.wikipedia.org/wiki/Choice_(command))

CHOICE /C:123
if %errorlevel% EQU 1 (goto OPTION1)
if %errorlevel% EQU 2 (goto OPTION2)
if %errorlevel% EQU 3 (goto OPTION3)
if %errorlevel% GEQ 4 (goto END)

If you use the A...Y instead you can get 1-100 in steps of 4.

I thought IBM was born with the world

Reply 3 of 8, by BinaryDemon

User metadata
Rank Oldbie
Rank
Oldbie

Since MS continued to add functionality to cmd/command.com long after MSDOS 6.22 it can be super annoying trying to figure out which features are supported in DOS when simply trying to learn/relearn batch scripting in 2019. I believe there are 3rd party utilities which you can use to achieve what you are trying to do - if I remember one of them was called ASK - possibly this? http://www.retroarchive.org/garbo/pc/batchutil/ask11.zip (At work, cant test)

I think DosBox could use work on it's batch script implementation - it's weaker than Dos 6.22's. No support for FOR loops, and you can't make the PC speaker beep with it's implementation of CHOICE.

Check out DOSBox Distro:

https://sites.google.com/site/dosboxdistro/ [*]

a lightweight Linux distro (tinycore) which boots off a usb flash drive and goes straight to DOSBox.

Make your dos retrogaming experience portable!

Reply 4 of 8, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi, what about 4DOS ? It's a command.com replacement with additional features, I think.
Also, what about FreeDOS ? Does it contain new features in that regard by any chance ? 😀

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 5 of 8, by Caluser2000

User metadata
Rank l33t
Rank
l33t
BinaryDemon wrote:

Since MS continued to add functionality to cmd/command.com .

NTs based Windows cmd.exe and Dos command.com are not the same thing. Never were. http://ask-leo.com/whats_the_difference_betwe … and_cmdexe.html

MS basicly dropped command.com development not long after Win9x was released. IBM on the other hand did provide some enhancements up to the early 2000s. Those enhancements were backward compatible back to XT class systems if they could take advantage of them.

There's a glitch in the matrix.
A founding member of the 286 appreciation society.
Apparently 32-bit is dead and nobody likes P4s.
Of course, as always, I'm open to correction...😉

Reply 6 of 8, by Thrash75

User metadata
Rank Newbie
Rank
Newbie

Thank you for all your answers, nice people. 😀 Going for a third party command was a nice idea! I found one called 'editvar' which just works beautifully. That is so awesome, thank you! 😀

But, man.. Next problem.. Checking if the entered number is within 1-100.. Am I missing something, or can MS-DOS 6.22 not do "greater than" or "less than" either?? Googling, I see things like "if (not) %a%==%b%" which can only be used to determine if it is, or is not, something. I tried replacing == with => or just >.. Also tried LSS and GTR. All I get is Syntax Errors. Can't find any third party commands for this. Just a tiny, tiny bit slightly frustrating.. 😀

Am I dumb, or just not seeing something obvious? Is it possible to somehow check if a variable is (not) in the 1-100 range, in 6.22? If someone know how, would it be possible to ask for a quick and simple coding example, so I can see how it works?

Brian

Reply 7 of 8, by CBM

User metadata
Rank Newbie
Rank
Newbie

also.. %1 %2 ... worked back then as well (dos 6.22 and perhaps all the way down to dos 3?)

if you added a %1 to your batch file, then checked if it was in use, then the bat file could also receive external information about the speed setting and maybe also decide to skip asking the user in case the bat file was supplied with a parameter

Main PC SPECS:
CPU: AMD Ryzen 5 2600
GPU: Powercolor Red Devil Radeon RX 5700 XT
RAM: 8GB*4 Corsair Vengeance LPX DDR4 3200MHz
Motherboard: ASUS Prime B450M-A
PSU: Corsair RM850

Reply 8 of 8, by Big Pink

User metadata
Rank Member
Rank
Member
Thrash75 wrote:

But, man.. Next problem.. Checking if the entered number is within 1-100.. Am I missing something, or can MS-DOS 6.22 not do "greater than" or "less than" either??

According to this book https://books.google.co.uk/books?id=u7oN-5y7n … epage&q&f=false, 6.22 can only do alphanumeric string comparison. Some kind of kludge using errorlevels might be possible. In the end, there's only so much you can do with COMMAND.

I thought IBM was born with the world