@echo off
echo PLEASE ENTER THE PASSWORD TO CONTINUE
set /p password="hello"
IF %c%==hello goto top
IF NOT %c%==goto PASSERROR
:passsuccess
title matrix
color 0a
mode 1000
:top
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
goto top
:passerror
echo try again
答案 0 :(得分:1)
您的问题是c
未定义。您输入的密码为password
,然后检查c
。
如果是空格或没有条目,请使用
if "%varentered%"=="somevalue" goto ...
例如,
if "%c%"=="" goto paserror
或
if not defined c goto ...
如果%c%
不等于goto
,请执行可执行文件passerror