Batch File Programming Commands - Inkey?

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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`
 
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.
 
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
 
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.
 
Back
Top