Batch File Programming Commands - Inkey?

G

Guest

I am trying to write a batch file for use in WindowsXP Home Edition. The file
will run from the Command Prompt and contains the xcopy command. I want to
include in the file the line
echo Do you want to continue? Y/N
Which command recognises and responds to the Y or N keypress?
I am told the INKEY command is not valid.
Many thanks for any help.
 
P

Poprivet

ToddMalcolm said:
I am trying to write a batch file for use in WindowsXP Home Edition.
The file will run from the Command Prompt and contains the xcopy
command. I want to include in the file the line
echo Do you want to continue? Y/N
Which command recognises and responds to the Y or N keypress?
I am told the INKEY command is not valid.
Many thanks for any help.

See the SET command, and if you have it or want to download it, the old
CHOICE is probably the best, IMO anyway.

Pop`
 
A

Ayush

ToddMalcolm wrote ::
I am trying to write a batch file for use in WindowsXP Home Edition. The file
will run from the Command Prompt and contains the xcopy command. I want to
include in the file the line
echo Do you want to continue? Y/N
Which command recognises and responds to the Y or N keypress?
I am told the INKEY command is not valid.
Many thanks for any help.

set /p Var=Do you want to continue ? Y/N :

echo %Var%

Good Luck, Ayush.
 
G

Guest

Thank you Pop.
How do I get to use the CHOICE command?
My program says it is an invalid command.
What is IMO?
Many thanks for the help
 
P

Pegasus \(MVP\)

IMO=In My Opinion.

You should stick to the inbuilt WinXP commands instead of
"borrowing" an Win9x command such as choice.exe. The
command that Ayush gave you will work perfectly well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top