How can I make an “are you sure” prompt in a Windows batchfile?

前端 未结 11 1216
时光说笑
时光说笑 2020-12-07 19:43

I have a batch file that automates copying a bunch of files from one place to the other and back for me. Only thing is as much as it helps me I keep accidentally selecting t

11条回答
  •  执念已碎
    2020-12-07 20:09

    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
    

提交回复
热议问题