How can I make an "are you sure" prompt in a Windows batchfile?
You want something like:
@echo off
setlocal
:PROMPT
SET /P AREYOUSURE=Are you sure (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
echo ... rest of file ...
:END
endlocal
try the CHOICE command, e.g.
CHOICE /C YNC /M "Press Y for Yes, N for No or C for Cancel."
The choice
command is not available everywhere. With newer Windows versions, the set
command has the /p
option you can get user input
SET /P variable=[promptString]
see set /?
for more info