批处理文件中的语法命令不正确

时间:2015-02-15 21:04:04

标签: batch-file syntax

我是批处理文件编码的新手并且得到了一个我无法解决的错误.. 问题发生在:secName,我在flash上​​做了一个版画屏幕(就在它退出cmd之前),它说:“所以你的名字是[%name%是]”然后“命令的语法不正确。 goto此时出人意料。“ 我现在已完成此编码:

@echo off
goto Welcome
title The Game Of Everything

:welcome
echo.
echo Welcome!
echo What is your name?
set /p name=Enter: 
goto secName


:secName
cls
echo.
echo so your name is %name%?
set /p secName:yes or no?:
if %secName%== yes goto begin 
if %secName%==no goto welcome

:begin
cls
echo.
echo Welcome %name%, to "The Game Of Everything"!
echo I hope you enjoy this mini-game, downloadable on your computer!
echo.
echo It isn't the prettiest, but who gives a toss right?







echo press any key to continue...
pause>nul

exit

1 个答案:

答案 0 :(得分:0)

改变这个:

set /p secName:yes or no?:

到这个

set /p secName=yes or no?: