这是我的批处理文件:
@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”,这可以吗?
答案 0 :(得分:0)
@echo off
:start
set /p test=">"
if "%test%" == "shutdown" goto shutdown
echo you typed: %test%
goto start
:shutdown
shutdown /s
exit