How do I request and receive user input in a .bat and use it to run a certain program?

前端 未结 9 1951
温柔的废话
温柔的废话 2020-12-23 14:37

This is what I have so far

@echo off
:Ask
echo Would you like to use developer mode?(Y/N)
set INPUT=
set /P INPUT=Type input: %=%
If %INPUT%==\"y\" goto yes          


        
9条回答
  •  滥情空心
    2020-12-23 14:54

    Add quotation marks (" ") around the %INPUT% so it looks like this:

    If "%INPUT%" == "y" goto yes
    If "%INPUT%" == "n" goto no
    If "%INPUT%" == "Y" goto yes
    If "%INPUT%" == "N" goto no
    

提交回复
热议问题