Batch file 我想使用一个批处理文件,如果您键入;“打招呼”;可以了

Batch file 我想使用一个批处理文件,如果您键入;“打招呼”;可以了,batch-file,cmd,echo,Batch File,Cmd,Echo,这是我的批处理文件: @echo off :start set /p test=">" if "%test%" == "shutdown" do shutdown if "%test%" == "say hello" goto echo :echo %echo% goto start :shutdown shutdown /s exit 但是我想用用户键入的任何内容替换“hello”,这可以做到吗 你也能摆脱插入符号吗? @echo off :start set /

这是我的批处理文件:

@echo off

:start

set /p test=">"

if "%test%" == "shutdown" do shutdown

if "%test%" == "say hello" goto echo

:echo

%echo%

goto start

:shutdown

shutdown /s

exit

但是我想用用户键入的任何内容替换“hello”,这可以做到吗

你也能摆脱插入符号吗?
@echo off

:start
set /p test=">"
if "%test%" == "shutdown" goto shutdown

echo you typed: %test%
goto start

:shutdown
shutdown /s
exit