The replacement of "choice.exe" in windows 2000 and later windows systems  

     

"Choice.exe" is a very commonly used DOS command that provides a simple user input mechanism in order to enable bat commands to interact with user. However this command is not included in the windows system after the release of windows 2000.

So what can we do to incorporate user input in batch commands in windows 2000?
At the beginning, I was looking for choice.exe command on windows 2000 platform. It appears that windows 2000 resource kit does contain this command, but I couldn't find it anywhere. Until one day I happen to discover that the "set" command is now completely capable of replacing "choice.exe". Then I realized that actually "choice.exe" is not needed in windows 2000 system any more.

Basically, "set" command is used to set value to a variable, but that's not all it does. This command has a "/p" switch that can set the variable with user input string instead of conventional values.

Here's how it is used:

set /p v=Please enter the value

When this command is executed, the system will display "Please enter the value" and then wait for the user input. Once the user type in his response and pressed "Enter" key, the value he entered will be set to the variable "v".

I know this finding is no big deal at all, but I think no matte how small it is, writing it down may actually help someone who happen to face the same puzzle with me in the future. I'd be glad I can help if this article save him some time...