Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: input  a name in the same line in CMD Prompt  (Read 2248 times)

0 Members and 1 Guest are viewing this topic.

nnf2540

  • Guest
input  a name in the same line in CMD Prompt
« on: September 15, 2006, 05:58:25 PM »
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 [highlight]Your name: Andrew[/highlight],
but my implementation looks like:
[highlight]Your name:
Andrew[/highlight]
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!
« Last Edit: September 15, 2006, 06:02:05 PM by nnf2540 »

g_p_l

  • Guest
Re: input  a name in the same line in CMD Prompt
« Reply #1 on: September 17, 2006, 05:32:52 AM »
Try this

Code: [Select]
Set /P MyName=Your name:
> AnyFile %MyName%

Graham

nnf2540

  • Guest
Re: input  a name in the same line in CMD Prompt
« Reply #2 on: September 17, 2006, 06:13:21 AM »
Great!!! :o
It DOES work! This is exactly what I want!
HEAPS of thanks, Graham.  ;D