<td>In dos mode in windows SET /p is working fine, but in real DOS is jumping over. After long time I found an answer after very long search. To ask for input in dos use small program readkey.exe or readln.exe (read131.zip) made by Ralph B Smith Jr with can be downloaded from <a href=”https://web.archive.org/web/20210123043122/http://sunsite2.icm.edu.pl/pub/garbo/pc/batchutil/” target=”_blank” rel=”nofollow”>http://sunsite2.icm.edu.pl/pub/garb…</a><br></td>
<td>I started new discussion because <a href=”https://web.archive.org/web/20210123043122/https://computing.net/answers/windows-xp/dos-set-p-not-waiting-for-input/166469.html” target=”_blank”>https://computing.net/answers/wi…</a> was closed.<p>In MS DOS “SET /P” is not working. If you will make bootable floppy or pen drive with DOS 6.22 or other it will not work but in windows command prompt is working fine.<br>I couldn’t find a command which will read from the keyboard for batch files</p><p>I hope it can be helpful for someone.</p><p>Regards<br>Dawid<br></p></td>
Mentioned in 1-st post utility ReadLn is not working properly in FreeDOS. I found a pure old beauty that works in any basic DOS flavor: 1987 program INPUT.COM It works like this from a .bat file:
:INPUT
input “Your question?” /
your_program_name /your_variable=%ANS%
:END
The entered string is saved into a variable %ANS% and can be used anywhere. But there are some issues with XMS managers.
If you’re limited to MS-DOS 6.22, your options are limited.You have choice, which probably won’t fulfill your needs. You have the %1 though %9 tokens, which will require you to manually start your batch file with the required input. You could use the included debug, and write your own real mode assembly keyboard handler. I’m sure someone somewhere still remembers how. You could rely on qbasic, which may or may not be installed on your MS-DOS boot disk, but then you’re writing a qbasic program, and not a batch file.
How To Ask Questions The Smart Way