Batch file 此时不需要批处理脚本游戏

Batch file 此时不需要批处理脚本游戏,batch-file,Batch File,我是一个新的批处理程序员,正在创建一个批处理“开始菜单”。我正在使用下面的文本,它说“X”在这个时候是不应该出现的。X是1,游戏,文本和其他东西。我想不出来。救命啊!我正在运行xpsp3并使用命令提示符。此外,如果有人发现任何其他错误,请通知我。给我发电子邮件superzemus@hotmail.com cls @echo off echo Welcome to the Start Menu! echo. echo Press ctrl-z to exit. Press G to play A

我是一个新的批处理程序员,正在创建一个批处理“开始菜单”。我正在使用下面的文本,它说“X”在这个时候是不应该出现的。X是1,游戏,文本和其他东西。我想不出来。救命啊!我正在运行xpsp3并使用命令提示符。此外,如果有人发现任何其他错误,请通知我。给我发电子邮件superzemus@hotmail.com

cls
@echo off
echo Welcome to the Start Menu!

echo.
echo Press ctrl-z to exit. Press G to play Adventure. Press T to enter Text Editor. 
pause
set Game= %gme% 
set Text= %txt%

IF select Game goto gme
IF select Text goto txt

:txt
echo You have chosen to enter the Text editor.
pause
start edit

:gme
echo You have chosen to play Adventure.
pause
start C:\Adventure.exe

您在这里想要的可能是
set/p

set /p choice=Press ctrl-z to exit. Press G to play Adventure. Press T to enter Text Editor.
然后比较如下:

if /i %choice%==G goto Game
if /i %choice%==T goto Text
goto :eof
或者使用不需要按Return键的
选项

choice /m "Press Q to exit. Press G to play Adventure. Press T to enter Text Editor." /c GTQ /n

if errorlevel 3 goto :eof
if errorlevel 2 goto Text
if errorlevel 1 goto Game
goto :eof
您的代码还有另一个问题:您应该在启动编辑器后退出批处理文件,以避免也启动游戏:

:Text
start edit
goto :eof

:Game
rem That's a horrible place to put something
start C:\Adventure.exe
goto :eof

您在这里想要的可能是
set/p

set /p choice=Press ctrl-z to exit. Press G to play Adventure. Press T to enter Text Editor.
然后比较如下:

if /i %choice%==G goto Game
if /i %choice%==T goto Text
goto :eof
或者使用不需要按Return键的
选项

choice /m "Press Q to exit. Press G to play Adventure. Press T to enter Text Editor." /c GTQ /n

if errorlevel 3 goto :eof
if errorlevel 2 goto Text
if errorlevel 1 goto Game
goto :eof
您的代码还有另一个问题:您应该在启动编辑器后退出批处理文件,以避免也启动游戏:

:Text
start edit
goto :eof

:Game
rem That's a horrible place to put something
start C:\Adventure.exe
goto :eof

使用批处理脚本作为游戏开始菜单很有趣。为什么不是一个小小的Windows窗体程序?哪个命令处理器?我没有在命令文件中看到SELECT。为什么不注释掉@echo off并再次运行脚本呢。它将回显每一行,您可以看到它失败的地方。或者在这里发布我想获得使用批处理(湿婆猛禽)的经验,但我不知道注释输出是什么意思(Preet Sangha)。很抱歉,我只做了64个小时。使用批处理脚本作为游戏开始菜单很有趣。为什么不是一个小小的Windows窗体程序?哪个命令处理器?我没有在命令文件中看到SELECT。为什么不注释掉@echo off并再次运行脚本呢。它将回显每一行,您可以看到它失败的地方。或者在这里发布我想获得使用批处理(湿婆猛禽)的经验,但我不知道注释输出是什么意思(Preet Sangha)。对不起,我只做了64个小时了。