DOSBox probably doesn't support setting environment variables through user prompt, so I downloaded working command.com from FreeDOS.
MS-DOS command-line set /p
-
10-06-2023 - |
Question
I want to create a MS-DOS .bat program that asks user to select an option using the following line:
set /p opt=Select your option:
The line is executed, but it doesn't do anything and continues executing the rest of the batch file without user prompt. What is wrong? I tried this in DOSBox 0.74.
Solution 3
OTHER TIPS
Look at the documentation for SET by typing set /?
or help set
from a Windows command prompt, and you will see that the /P option is only available if extensions are enabled. The extensions are a part of Windows CMD.EXE, they are not available in the old DOS COMMAND.COM. In other words, the /P option is only available in Windows. It was not available in true DOS, so it makes sense that it will not work in DosBox either.
you probably forgot a space after equals sign
set /p opt= Select your option:
P.S : use quotes around the string