I have a DOS batch file that show some results on the cmd console. I want users to press Enter to run program or press any other key on the keyboard to exit.
I don’t want to use options/choices because in that case user will have to enter at least something which I need to check and set the action.
Example:
At the end of the cmd console something say like this
Press ENTER to open abc.exe or press any key on the keyboard to exit!
Thanks!
Something like this
EDIT: If you want just “any key” without pressing enter then this is impossible with the DOS scripting language but you could write a little exe utility who will do that for you.
Here is how it looks:
If you press “enter” then we get:
I have not abc.exe so there is an error message. The other way around
gives
Basically set /p ask the user to specify the value of “Choice” when it is just enter then it is an empty string and we can start otherwise we end. Change it around for your liking.