문제

Okay, so I am currently trying to write a program in Batch and I want to be able to program the ENTER key to be the button without just simply typing pause or pause>nul because that will let any key work and i don't want that as an option.

This is what it would normally look like:

set /p continue= if %continue% == [ENTER KEY GOES HERE] goto start

Where I have typed [ENTER KEY GOES HERE] is where I obviously want to put the Enter key option to proceed, but I don't know how to do that considering it doesn't to be as simple as

echo Press 'C' to continue... set /p continue= if %continue% == C goto start

If anyone has any ideas, PLEASE tell me, I would greatly appreciate it!

도움이 되었습니까?

해결책 3

I would simply ask for some input, as in:

set /p Var1="Press [ENTER] key to continue."

The user will have to press enter to continue.

다른 팁

This will do it: it firstly clears the variable and if enter alone is pressed then it will remain empty.

set "continue="
set /p continue=
if not defined continue goto start

An easy way to do it is:

set /p continue=
if [%continue%]==[] goto start

This works if nothing is entered.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top