Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi there,
I'm currently running XP. How would it be possible to use a user_input system to do the following for example:
The user enters their name at a prompt, then their height at a seperate request.
The file then outputs "Hi %, your age is %!"
Any help appreciated,
Thanks.

Is it height or age you want to ask on the second input? I'll assume it's age, doesn't make much difference. This will do:
@echo off
set name=
:input_name
set /P name=What's your name? %=%
if "%name%"=="" goto input_name
set age=
:input_age
set /P age=How old are you? %=%
if "%age%"=="" goto input_age
echo Hi %name%, your age is %age%!-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

Okay... that doesn't seem to work, when I execute the file, nothing echos at all.
Is it for Windows 98?

That script works just fine on Windows 2000 and XP environments. It will not run on Windows 98, nor on NT4. I've shown such method because you stated you were under XP.
In case you're under an OS other than Windows 2000 and XP, another method must be used. Which is the intended OS?
If you're on XP, I see absolutely no reason why it shouldn't work. Did any error messages come up? Are the prompts made, or the script simply ends instantly?
You gotta cut-paste that code I posted into a text file and save it with a .BAT extention, no other extention will work, you know that, don't you?
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
DOS Commands
|
Msdos boot partition?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |