A Dos batch file question.

kxy

Senior member
Jan 27, 2001
467
0
0
I am trying to write a batch file that will ask for a user's input, how do I do that? I know the menu command gives you the option of chosing different menus, but that is not exactly what I want.

For example:
in a typical DOS screen

plese enter a number:
//it will pause here until the user has enter the number, then it will display this number

You have entered number:x
 

kxy

Senior member
Jan 27, 2001
467
0
0
heh, I solved it myself. :)
I will post my answer for anyone who is intereted to know, it turns out to be more complicated than I thought.

echo Enter your first name
echo set name=%%5>enter.bat
fc con nul /lb1 /n | date | find " 1: " > temp.bat
call temp.bat
del temp.bat>nul
del enter.bat>nul
echo Your name is %name%.

"enter.bat
set name=
:loop
set name=%name% %5
shift
if not "%5"=="" goto loop