Page 1 of 1

How can I input a name in the same line in CMD Prompt

Posted: 16 Sep 2006 13:50
by DOSNVC
I have composed a batch file. When you double click on it, a command window prompts up displaying "Your name:"

Now I want the users type their names in the same line,
looking like Your name: Andrew,
but my implementation looks like:
Your name:
Andrew

The users typed their names in the next line, which is not what I what.

After typing name and press enter, the user's name should be redirected to a text file. How can I do it? Thanks a lot! :D

Posted: 17 Sep 2006 19:55
by DosItHelp
Try:

Code: Select all

set /p username=Your Name: 
echo.%username%>>usernames.txt

:wink: