SET /P not waiting for input (not working)DOS

October 15, 2010 at 00:56:09
Specs: DOS
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 ( made by Ralph B Smith Jr with can be downloaded from

See More: SET /P not waiting for input (not working)DOS

Report •

October 15, 2010 at 01:05:12
You are correct that there is no set /p in DOS.

Is there a question?

Life is too important to be taken seriously.


Report •

October 15, 2010 at 03:40:42
I started new discussion because was closed.

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.
I couldn't find a command which will read from the keyboard for batch files

I hope it can be helpful for someone.


Report •

October 15, 2010 at 07:23:27
Windows Command Prompt does not adhere to MS-DOS' rules, nor does it have the same commands. It does kinda look like MS-DOS if you squint hard enough, I guess. We've been over this before.

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

Report •

Related Solutions

November 23, 2010 at 09:30:55
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 "Your question?" /
your_program_name /your_variable=%ANS%

The entered string is saved into a variable %ANS% and can be used anywhere. But there are some issues with XMS managers.

Report •

November 26, 2010 at 11:26:49
May be you can help me guys.

I've some "automation" issue: INPUT and ReadLN utilities are quite old, they don't work well with XMS managers in FreeDOS. So when a .bat below is launched from a file manager (Volkov Commander as an example), the variable %ANS% remains empty after the text is entered at the prompt. It works after I quit the File Manager - but how to quit it automatically? Or any other workaround working for "any" file manager?

READLN "Enter name of ISO file: " ans

I found such explanation (if its relevant):

"Input programs in DOS can't write the changed variable to the parent environment of the program that started it. They use the system BIOS function (INT 10h) to read the keyboard, and this function call does not support input redirection.

Report •

Ask Question