我有批处理代码,将应允许我键入“ mindustry”(即文件名),它会提示我输入哪个版本,在我键入“ v3”后,如果没有引号
@echo off
for /l %%x in (1, 1, 10) do echo.
echo here are what versions of Mindustry i have:
echo - v3 (version 3)
echo - b4 (version 4 beta)
set /p version = "what version will you play >>> "
@echo on
if /I %version%=="v3" (
cd mindustrypc/v3 ::go to minustry's location
mindustry ::open mindustry.exe it is the game i have multiple versions of and why i have the launcher code
exit
)
我在运行它时得到了它:
C:\Users\■■■■■>mindustry
here are what versions of mindustry i have:
- v3 (version 3)
- b4 (version 4 beta)
what version will you play >>> v3
( was unexpected at this time.
C:\Users\■■■■■>if /I =="v3" (
C:\Users\■■■■■>
请注意,我输入了v3,它不会自动执行此操作。我还注意到它无法识别我的变量
有人知道我的代码怎么了吗?我将再添加1条if语句来检查是否输入“ b4”。