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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
DOSNVC

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

#1 Post by DOSNVC » 16 Sep 2006 13:50

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

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#2 Post by DosItHelp » 17 Sep 2006 19:55

Try:

Code: Select all

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

:wink:

Post Reply