I'm trying to write a windows batch script to do some work for me. Here is the code:
@echo off
cls
set /P AA="Is this information correct (Y/[N]) ? "
if /I "%AA%" == "Y" (
echo Setting up %DATE% %TIME% ...
echo Copying stuff to the places ...
set /P BB="Overwrite (Y/[N]) ? "
if /I "%BB%" == "Y" (
echo Executing xxx ...
) else echo NOPE1 [%BB%]
set /P CC="Overwrite (Y/[N]) ? "
if /I "%CC%" == "Y" (
echo Executing xxx ...
) else echo NOPE2 [%CC%]
echo All set !
) else echo Setup aborted [%AA%] !
pause
The 2nd and 3rd answers are always empty, and when I remove the quotes from the prompt it blames the `?' character. What is wrong with the code ?
Thanks.