如何在批处理文件中使用多个单词作为用户输入?

时间:2017-04-26 17:55:23

标签: windows batch-file

如何让它工作,以便当我有多个单词作为用户输入时?百分比?

@echo off

Title programming test

set /p Heyyya= Type a command:

if %Heyyya% == "stop now" echo Correct

if not %Heyyya% == "stop error" echo sorry

pause >nul

1 个答案:

答案 0 :(得分:0)

@echo off

echo Title programming test
set /p Heyyya=Type a command:

if "%Heyyya%"=="stop now" (echo Correct & goto:correct )
if not "%Heyyya%"=="stop error" echo Sorry

:correct

pause >nul